#include<stdio.h>
#include<math.h>
int main()
{
    unsigned long long int n,mul=1,c0=0,i,k;
    scanf("%llu",&n);
    unsigned long long int arr[n];
    for(i=0;i<n;i++)
    {

        scanf("%lld",&arr[i]);
        if(arr[i]==0)
        {
            c0++;
        }

    }
    if(c0>0)
    {
        printf("0\n");
    }
    else
        {
            for(k=0;k<n;k++)
    {
        if(arr[k]<=((1000000000000000000)/mul))
        {
            mul*=arr[i];
        }
        else
        {
            printf("-1\n");
            return 0;
        }
    }


        printf("%lld\n",mul);

        }



    return 0;
}
