#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll m=1000000000000000000;
    ll n;
    cin >> n;
    ll a[n],i,f=1;
    for(i=0;i<n;i++)
    {
        cin >> a[i];
        if(a[i]==0)
            f=0;
    }
    if(f==0)
    {
        cout << "0" << endl;
        return 0;
    }
    sort(a,a+n);
    ll s=a[n-1];
    if(s>m)
    {
        cout << "-1" << endl;
        return 0;
    }
    for(i=n-2;i>=0;i--)
    {
        s=s*a[i];
    if(s>m)
    {
        cout << "-1" << endl;
        return 0;
    }
    }
    cout << s << endl;
    return 0;
}
