#include<stdio.h>
int main()
{
   long long int n,a[1000000],i,m=1;
    scanf("%lld/n",&n);
    for(i=1; i<=n; i++)
    {
        scanf("%lld",&a[i]);
    }

    for(i=1; i<=n; i++)

        m= m*a[i];
if( m>=0 && m <= (1000000000000000000))
{
     printf("%lld\n",m);
}

    else if(m>=1000000000000000000){
        printf("-1\n");
    }
return 0;
}