#include <stdio.h>

int main(void){

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

    return 0;
}