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

#define mod 1000000007
#define limit 200001
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(i = 0; i < n; i++)
#define max(a,b) {if(a>b){return a;}return b;}
#define min(a,b) {if(a<b){return a;}return b;}
int up_int(const void *a, const void *b){return *(int*)a - *(int*)b;}
int down_int(const void *a, const void *b){return *(int*)b - *(int*)a;}
int up_char(const void *left, const void *right) {return strcmp((char *)left,(char *)right);}
int down_char(const void *left, const void *right) {return strcmp((char *)right,(char *)left);}

int main(){
    ll a[100002];
    ll sum,n;
    int flag = 0;
    
    scanf("%lld",&n);
    for(int i = 0; i < n; i++) scanf("%lld",&a[i]);
    
    sum = a[0];
    for(int i = 1; i < n; i++){
        if(sum > 500000000000000000 && a[i] >= 2){
            flag = 1;
            break;
        }else{
            sum *= a[i];
        }
    }
    
    if(flag == 0 && sum <= 1000000000000000000) printf("%lld\n",sum);
    else printf("-1\n");
    return 0;
}

