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