#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main()
{
    int n,i,j,flag = 0;
    long long a,out = 1;
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%lld",&a);
        out = out*a;
        if(a==0){
            out = 0;
            break;
        }
        if(out>(long long)pow(10.0,18.0)){
            for(j=i+1;j<=n;j++){
                scanf("%lld",&a);
                if(a==0){
                    flag = 1;
                    i=n+1;
                    break;
                }
            }
        }
    }
    if(flag==0&&out>(long long)pow(10.0,18.0)) printf("-1\n");
    else if(flag==1) printf("0\n");
    else printf("%lld\n",out);
    return 0;
}



