#include<stdio.h>
int main()
{
    unsigned long long int n,a,mul=1;
    scanf("%llu",&n);
    mul=1;
    while(n--)
    {
        scanf("%llu",&a);
        mul=mul*a;
    }
    if(mul>1000000000000000000)
        printf("-1\n");
    else
        printf("%llu\n",mul);
    return 0;
}