#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define INF 0x3f3f3f3f 
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)
#define ll long long int
#define pi 3.14159265358979
int main() {
    ll n,i,ans=1;
    cin>>n;
    ll a[n];
    for(i=0;i<n;i++)
      cin>>a[i];
    for(i=0;i<n;i++)
      ans=ans*a[i];
    if(ans>1000000000000000000)
    cout<<-1;
  else
    cout<<ans;
    return 0;
}