#include<stdio.h>
#define ll long long
int main()
{
    ll m=1000000000000000000;
    ll a,i;
    scanf("%ld",&a);
    ll b=1,c[a],f=1;
    for(i=0;i<a;i++)
    {
        scanf("%ld",&c[i]);
        if(c[i]==0)
           f=0;
    }
    if(f==0)
    {
        printf("0\n");
        return 0;
    }
    for(i=0;i<a;i++)
        {
             b*=c[i];
             if(b>m)
             {
                 printf("-1\n");
                 return 0;
             }
        }

    printf("%ld\n",b);
     return 0;
}
