#include <stdio.h>
#include <stdlib.h>

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