#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
int main(){
	int n;
	cin >> n;
	ll ans = 1;
	int f = 0;
	rep(i, n){
		ll in;
		double in0;
		cin >> in;
		in0 = in;
		if((double)ans > (double)1000000000000000000/in0){
			f = 1;
			ans = 1;
		}else{
			ans *= in;
			if(ans > 1000000000000000000){
				f = 1;
				ans = 1;
			}
		}
	}
	if(f == 1 && ans != 0){
		cout << -1 << endl;
	}else{
		cout << ans << endl;
	}
	return 0;
}