#include<stdio.h>
int main()
{
    unsigned long long int t,s=1;
    scanf("%llu",&t);
    while(t--)
    {
         unsigned long long int n,k;
            scanf("%llu",&n);
        s=s*n;
    }



    if(s<=1000000000000000000)
    {
        printf("%llu",s);
    }else{
        printf("-1");
    }

    return 0;
}