#include<stdio.h>
signed main(){
    int n,i;
    long long sum=1;
    long long a[100];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%lld",&a[i]);
        sum=sum*a[i];
    }
    if(sum<1000000000000000001){
        printf("%lld\n",sum);
    }else{
        printf("-1\n");
    }
    return(0);   
}