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