#include<stdio.h>

int main(void){
    long int N;
    int A[100000];
    long int b;
    long int i;
    long int a;

    scanf("%ld", &N);
    
    for(b=0;b<=N-1;b++){
    scanf("%d", &A[b]);
    }
    
     a = A[0];

    for(i=1;i<=N-1;i++){
       a = a*A[i];
    }
    if(a<=1000000000000000000){
    printf("%ld\n",a);
    return 0;
    }
    else{
    printf("-1\n");
    return 0;
    }
    return 0;
    
}