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