#include<stdio.h>
int main(void)
{
	int n;
	long long a;
	long long ans = 1;
	int flag = 0;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%lld", &a);
		ans *= a;
		if (ans > 1000000000000000000)
			flag = 1;
		if (a == 0)
		{
			flag = 0;
			ans = 0;
		}
	}
	if (flag == 1)
		printf("-1\n");
	else
		printf("%lld\n", ans);
	return 0;
}