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

int n,i,ans=1ll;
int a[100010];

signed main()
{
	cin>>n;
	for (i=0;i<n;i++)
	{
		cin>>a[i];
		if (a[i]==0)
		{
			cout<<0;
			return 0;
		}
	}
	for (i=0;i<n;i++)
	{
		if (1000000000000000000ll/ans<a[i])  return cout<<-1<<endl,0;
		ans*=a[i];
	}
	cout<<ans<<endl;
	
	return 0;
}