#include<bits/stdc++.h>
using namespace std;
int n;
long double a[100001];
int main(){cin>>n;
	int i;
	long long s=1;
	for(i=1;i<=n;++i){cin>>a[i];
	if(a[i]==0){cout<<0;
	return 0;	
	}
	}
	for(i=1;i<=n;++i){
		if(s>(long double)1e18/a[i]){cout<<-1;
		return 0;
		}
		s*=a[i];
	}
	cout<<s;
	return 0;
} 