#include<stdio.h>
using namespace std;
#define ll unsigned  long long
#define maxn 100005
#define H 1000000000000000000
ll a[maxn];
int main(void)
{
	ll n,t=1;
	scanf("%lld",&n);
	for(int i=0;i<n;++i)
	{
		scanf("%lld",&a[i]);
		if(a[i]==0)
		t=0;
	}
	_int128_t sum=0; 
	if(t)
	{
		sum=1;
		for(int i=0;i<n;++i)
		{
		sum*=a[i];
		if(sum>H)
		{
			printf("-1\n");
			return 0;
		}
		}
	}
	printf("%lld\n",(ll)sum);
	return 0;
}