#include <iostream>
#define ll long long
 
using namespace std;
 
int main() {
    ll t, x, ans = 1;
    cin >> t;
    while (t--) {
        cin >> x;
        if (!x) {
            ans = 0;
            break;
        }
        if (1000000000000000000ll / ans < x)
            ans = -1;
        else
            ans *= x;
    }
    cout << ans;
}
