#include<bits/stdc++.h>
using namespace std;
template <typename T> using vec = vector<T>;

int main()
{
    int n;
    cin >> n;
    long ans =1;
    long a;
    vool flag = true;
    while (cin>>a)
    {
        ans *= a;
        if(ans>1000000000000000000)
        {
            flag = false;
            cout << -1 << endl;
            break;
        }
    }
    if(flag)
    {
        cout << ans << endl;
    }
    
}