#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repbtw(i, a, b) for (int i = a; i <= (int)(b); i++)
#define all(v) v.begin(), v.end()
#define pr(x) cout << x << endl


int main()
{
    int64_t n;
    cin >> n;

    int64_t mul = 1;
    int64_t a_in;
    rep(i, n){
        cin >> a_in;
        if(a_in == 0){
            pr(0);
            return 0;
        }

        if(a_in > 1000000000000000000 / mul){
            pr(-1);
            return 0;
        }
        mul *= a_in;

    }

    pr(mul);
    return 0;
}

