#include <iostream>
using namespace std;
int main()
{
    int n;
    long long a, b = 1;
    cin >> n;
    for(int i = 0; i < n; i++) {
        scanf("%lld", &a);
        if (a == 0) {
            b = 0;
        } else if(b == -1 || b > (long long)1e18 / a){
            b = -1;
        } else {
            b *= a;
        }
    }
    cout << b << endl;
    return 0;
}