#include<stdio.h>

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