#include<stdio.h>
#include<stdlib.h>
#define MAX 1000000000000000000
int main(void){
  
  int i,n;
  long long p[100001];
  long long ans = 1;
  long long def = 1000000000000000000;
  int zero_flag = 0;
  
  scanf("%d",&n);
  for(i=0;i<n;i++){
	scanf("%lld",&p[i]);
    if(p[i] == 0) {
      printf("0");
      return 0;
      zero_flag = 1;
    }
  }
  
  long long prod = 1;
  for(i=0;i<n;i++){
    if(p[i]<=1000000000000000000/prod){
   prod = prod * p[i]; 
    }else{ 
      printf("-1");
      return 0;
    }
  }
  
  printf("%lld",prod);
  
  return 0;
}