// B - Multiplication 2
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
	int n; cin>>n;
	ll inf = 1e18;
	ll ans = 1;
	bool ng = false;
	while(n--){
		ll a; cin>>a;
		if(a == 0){ puts("0"); return 0; }
		if(ng || inf/a < ans) ng = true;
		ans *= a;
	}
	if(ng) puts("-1");
	else cout<< ans <<endl;
}
