#include  <stdio.h>

int main(void)
{
    int i;
    long int n;
    long long int a,b=1;
    scanf("%ld",&n);
    
    for(i=0;i<n;i++) {
        scanf("%lld",&a);
        b = b*a;
    }
    if(b > 1000000000000000000 || b < 0)
        b = -1;
    printf("%lld",b);
    
    return 0;
}