#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL inf = 1e18;
int main() {
	int n;
	LL p=1,a;
	cin>>n;
	vector<LL> v(n);
	for(auto &i:v) cin>>i;
	sort(v.begin(), v.end());
	for(auto a:v) {
		if(!a) {
			p=0;
			break;
		}
		if(a > inf/p) {
			p=-1;
			break;
		} else
			p *= a;
	}
	cout<<p<<endl;
	return 0;
}
