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