#include<bits/stdc++.h>
using namespace std;

long long a[100006];
__int128 N=1e18;

int main()
{
	int n;
	__int128 tmp=1;
	scanf("%d",&n);
	for(int i=1;i<=n;++i) cin>>a[i];
	sort(a+1,a+n+1); 
	for(int i=1;i<=n;++i) {
		if(a[i]==0) {puts("0");return 0;}
		if(tmp*a[i]<=N) tmp*=a[i];
		else {puts("-1");return 0;}
	}
	cout<<(long long)tmp;
}