#include<stdio.h>
int main (void){
    int N,i;
    long long int result;
    long long int A[100000];
    result = 1;
    scanf("%d",&N);
    for(i=0;i<N;i++){
        scanf("%lld",&A[i]);
    }
      for(i=0;i<N;i++){
    if(A[i]<=1000000000000000000/result){
      result= result * A[i];
    }else{
      printf("-1\n");
      return 0;
    }
  }
     printf("%lld\n",result);
    return 0;
}