#include<stdio.h>

int main()
{
    long long int A,n,mul=1;
    
    if(n>1 && n<1000000000000000)
    {
        scanf("%lld",&n);

    while(n--)
    {
         scanf("%lld",&A);
        mul=mul*A;
    }

    if(mul>1000000000000000000)
        printf("-1");
    else
        printf("%lld\n",mul);
    }

    
    return 0;
}
