#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
bool f;
ll ans=1;
ll check=1e18;

int main(){
	cin>>n;
	while(n--){
		ll x;cin>>x;
		if(x==0){
			f=true;
			continue;
		}
		ans*=x;
		check/=x;
	}
	

	if(f) cout<<0;
	else{
		if(check<1) cout<<-1;
		else cout<<ans;
	}
	return 0;
}
