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