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