#include <bits/stdc++.h>
#define MOD 1000000007
#define ll long long int
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
 
using namespace std;
 
int main()
{
	
    fastio
    ll n, x;
  __int128 ans=1, comp=1000000000000000000;
  cin>>n;
  for(int i=0; i<n; i++)
  {
    cin>>x;
    ans*=x;
    if(ans>comp)
    {
      ans=-1;
      break;
    }
  }
  ll rans=ans;
  cout<<rans;
}