#include<bits/stdc++.h>
#define MAXI 1000000000000000000
#define lint long long
using namespace std;

int main(){
	int n;
	lint s=1;
	cin>>n;
	vector<lint> v(n);
	
	for(lint &x:v){
		cin>>x;
		if(x == 0) s=0;
	}
	if(s)
		for(lint &x:v){
			if(s>0 && x > MAXI/s){
				s = -1;
				break;
			}
			s *= x;
		
		}
	cout<<s<<"\n";
;	return 0;
}
