#include <stdio.h>
int main()
{
    int a,b;
    long long int  c=1000000000000000000,d=1;
    scanf("%d",&a);
    long long int op[a];
    for(b=0;b<a;b++)
    {scanf("%lld",&op[b]); if(op[b]==0) d=0;}
    for(b=0;b<a;b++)
    {
        if(op[b]==0) {d=0; break;}
        else if(c/op[b]<d)  {d=-1; break;}
        else d*=op[b];
    }
    printf("%lld",d);

    return 0;
}
