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