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