
    
    //written by: rishav2416
#include <bits/stdc++.h>
#define ll long  long
#define lli long long int
#define ld long double
#define mod 1000000007
#define max_char 128
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define lbd lower_bound
#define ubd upper_bound
#define PI 3.141592653589793238
#define pf push_front
#define all(x) x.begin(),x.end()
#define input(arr,n) for(ll c1=0;c1<n;c1++)cin>>arr[c1];
#define arrinit(arr,n,k) for(ll c1=0;c1<n;c1++) arr[i]=k;
#define rep(i,a,n) for( ll i=a ; i<n ; i++)
#define revrep(i,a,n) for(ll i=a; i>=n ; i--)
#define mems(x, y) memset(x, y, sizeof(x))
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
#define INF 1e18a



ll power(ll base,ll pow)
{
   ll res=1;
   while(pow)
   {
        if (pow%2!=0)  res=(res*base);
        base=(base*base);
        pow/=2;
   }
   return res;
}

ll inv(ll i){//mod must be prime and i must be coprime with mo
	return power(i,mod-2,mod);
}

std::string str="All Good Till Here";

/////////////////////////////////////////////////////////////////////////////////

void solve()
{
  ll i,j,x,n;
  cin>>n;
  lli p=1,a[n];
  input(a,n);
  rep(i,0,n)
  {
    p*=a[i];
    if(p>=power(10,18))
    {
      cout<<"-1\n";
      break;
    }
  }
}
int32_t main()
{
    fastio
	ll tt;
	// cin>>tt;
  tt=1;
	while(tt--)
	{
    solve();
	}
    return 0;
}
