#include<stdio.h>
int main()
{
    unsigned long long int b=0,c=1,i,t,n[100010];
    scanf("%llu",&t);
    for(i=1;i<=t;i++)
    {
        scanf("%llu",&n[i]);
        if(n[i]==0)
        {
            b=1;
            printf("0\n");
            return 0;
        }
    }
    for(i=1;i<=t;i++)
    {
        if(b==1)
        break;
        c=c*n[i];
        if(c>1000000000000000000)
        {
            printf("-1\n");
            break;
        }
    }
    if(c<=1000000000000000000)
    //scanf("%llu %llu",&a,&b);
    printf("%llu\n",c);
    return 0;
}