#include <stdio.h>
//#include <string.h>

int main(void){
  
  int n;
   long int sum = 1;
  long int a[100005];
  
  scanf("%d", &n);
  
 for(int i=0;i<n;i++){
   scanf("%ld", &a[i]);
   sum = sum*a[i];
   if(sum >1000000000000000000){
     printf("-1");
     return 0;
 	}
 }
  
  printf("%ld", sum);
  return 0;
}

  