#include<stdio.h>

int main(void)
{
	long long a[100000] = { 0 };
	int i;
	long long N,ans=1;

	scanf("%lld", &N);

	for (i = 0; i < N; i++)
	{
		scanf("%lld", &a[i]);

		ans = a[i] * ans;
		if (a[i] == 0)
		{
			ans = 0;
			break;
		}
		else if(ans>1000000000000000000)
		{
			ans = -1;
			break;
		}
	}
	printf("%lld", ans);
	return 0;
}