#include <stdio.h>

int main()
{
    int n; 
    scanf("%d", &n); 
    
    int i; 
    long long int pro = 1; 
    
    for(i = 1; i <= n; i++)
    {
        long long int x; 
        scanf("%lld", &x); 
        
        pro = pro * x; 
    }
    
    if(pro > 1000000000000000000)
        printf("-1\n"); 
    
    else 
        printf("%lld\n", pro); 
    
    return 0; 
}
