
#include <bits/stdc++.h>

#define ll int64_t
using namespace std;
#include <cstdlib> 
#include <math.h>
#include<cstdio>
#include<cstring>
#define FOR(I, A, B) for (int I = (A); I <= (B); I++)
#define fo(i,n) for(int i=0;i<n;i++)
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define dbg(x) cout << #x << " = " << x << endl
#define dbg2(x,y) cout << #x << " = " << x << ", " << #y << " = " << y << endl
#define dbg3(x,y,z) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl
#define dbg4(x,y,z,q) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << ", " << #q << " = " << q << endl
#define scan(char_array) scanf("%[^\n]s",&char_array)
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
const ll our=1e18l;
int main(){
    IOS
    ll n;
    cin>>n;
    ll tmp=1;
    ll aa;
    bool fl=false;
    bool haszero=false;

    ll a[n];
    fo(i,n){
    	 cin>>a[i];
    	 if(a[i]==0) haszero=true;
    }
    if(haszero) {
    	cout<<0<<endl;
    	return 0;
    }
    fo(i,n){
    	if(tmp>our/a[i]) {
    		tmp=-1;
    		fl=true;
    	}
    	if(!fl) tmp=tmp*a[i];
    }

    cout<<tmp<<endl;
}