#include<bits/stdc++.h>
#include <cmath>
#include <climits>

using namespace std;

typedef long long ll;
#define PI 3.14159265

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    ll n;
    cin >> n;
    ll prev = 1;
    ll c = 1;
    bool yap = false;
    for(ll i = 0; i < n; i++){
        ll a;
        cin >> a;
        prev = c;
        c *= a;
        if(prev > c && a != 0)yap = true;
    }
    if(yap){
        cout << -1 << endl;
        return 0;
    }
    ll comp = pow(10, 18);
    if(c > comp)
    {
        cout << -1 << endl;
        return 0;
    }
    else cout << c << endl;
}