#include<stdio.h>
int main  (){

  
  long N;
  long ans = 1;
  scanf("%ld",&N);
  long A[N];
  for(int i=0;i<N;i++){
    scanf("%ld",& A[i]);
    ans = A[i]*ans;
  }
   if(ans>1000000000000000000){
      printf("-1");
    }else{
     int vout = (int)ans;
    printf("%ld", vout);
   }
    return 0;