#include<stdio.h>
int main  (){
  long int N;
  long int ans = 1;
  long int a = 1000000000000000000;
  scanf("%ld",&N);
  long A[N];
  for(int i=0;i<N;i++){
    
    scanf("%ld",& A[i]);
    ans = A[i]*ans;
    if(ans>a){
    break;
  }
  }
    if(ans>a){
        printf("-1");
        
      }else{
      printf("%ld", ans); 
    }
  return 0;
}