#include<iostream>
#include<math.h>
#include<bits/stdc++.h>
#include<queue>
#include<cstdio>
#define rep(i,n) for (int i=0;i<(n);++i)
using ll = long long;
using namespace std;
using P = pair<int,int>;

int main(){
    int n;
    cin>>n;
    ll a[n];
    ll ans=1;
    int zero=0;
    rep(i,n){
        cin>>a[i];
        if(a[i]==0) zero++;
    }
    if(zero>0){
        cout<<0<<endl;
        return 0;
    }
    rep(i,n){
        if(a[i]<1000000000000000000/ans){
            ans = ans*a[i];
        }else{
            cout<<-1<<endl;
            return 0;
        }
    }
    cout<<ans<<endl;
    return 0;
}