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