#include<stdio.h>
signed main(){
    int N, i;
    long long sum;
    scanf("%d",&N);
    long long A[N];

    while(i<N){
     
     scanf("%lld",&A[i]);
     i++;
    }
     sum = 1;
     i=0;

     while(i<N){
         sum = sum * A[i];
         i++;
     }

     if(sum > 1000000000000000000){
         printf("%d\n",-1);
     }else{
         printf("%lld\n", sum);
     }

    return (0);
}