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