#include <stdio.h>

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