#include<stdio.h>
int main (void){
    int N,i,result;
    int A[100000];
    scanf("%d\n",&N)
    for(i=0;i<N;i++){
        scanf("%d\n",&A[i]);
        result = result * A[i];
    }
    if(result>=1000000000000000000){
        printf("-1");
    }else{
        printf("%d\n",result);
    }
    return 0;
}