#include<stdio.h>
int main(){
  int x,i;
  long a,sum=1;
  scanf("%d",&x);
  for(i=0;i<x;i++){
    scanf("%d",&a);
    sum*=a;
  }
    if(sum>1000000000000000000){
      sum=-1;
    }
  printf("%ld\n",sum);
}