#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
    long long p = 1;
    int n;
    long long a;
    cin >> n;
    for (int i=0; i < n; i++) {
        cin >> a;
        if (p*a > 1000000000000000000 || p*a < 0) {
            p = -1;
            break;
        } else {
            p *= a;
        }
    }
    cout << p << endl;
}