#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define GET_ARRAY_SIZE(a)   (sizeof(a)/sizeof(a[0]))
#define LL long long
LL facctorialMethod(int k);
int main(){
    LL n,a,sum;
    cin >> n ;
    vector<LL> array_a(n);

    for(int i = 0; i < n; i++) {
        cin >> a;
        array_a[i] =  a;
    }
    sort(array_a.begin(),array_a.end());
    sum = 1;
    for(int i = 0; i < n; i++) {
        sum *= array_a[i];
        if(sum > 1000000000000000000) {
            cout << -1 << endl;
            return 0;
        }
    }


    cout << sum << endl;

    return 0;
}

LL facctorialMethod(int k){
    int sum = 1;
    for (int i = 1; i <= k; ++i){
        sum *= i;
    }
    return sum;
}
