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

        scanf("%lld",&arr[i]);
        mul=(mul*arr[i]);

    }
    if(mul<=1000000000000000000)
    {
        printf("%lld\n",mul);
    }
    else
    {
        printf("-1\n");
    }

    return 0;
}
