#include <bits/stdc++.h>
using namespace std;
//typedef
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
//define
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)

int main(){
    ll n,b=1;
    cin >> n ;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];

    rep(i,n){
        b *= a[i];
        if(b >1000000000000000000) {
            cout << "-1" << endl;
            return 0;
        }
    }
    cout << b << endl;
 return 0;
}