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

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



