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

int main()
{
	int n;
	cin >> n;

	vector<int64_t> a(n);
	for (int i=0;i<n;++i)
	{
		cin >> a[i];
		if (a[i]==0)
		{
			cout << 0 << endl;
			return 0;
		}
	}

	int64_t prod=1;
	for (int i=0;i<n;++i)
	{
		if ( 1e18L/prod < a[i] )
		{
			cout << -1 << endl;
			return 0;
		}
		prod*=a[i];
	}
	cout << prod << endl;
}





