#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    int n,done=0,doen=0;
    scanf("%d",&n);
    long long sum=1;
    while(n--)
    {
        long long t;
        scanf("%lld",&t);
        if(t==0)
            done=1;
         else if(sum*t>1000000000000000000||t>1000000000000000000/2&&sum!=1)
         doen=1;
         else if(doen==0)
            sum*=t;

    }
    if(done)
        printf("0\n");
    else if(doen)
        printf("-1\n");
    else printf("%lld\n",sum);
    return 0;
}
