#include <stdio.h>

int main(void)
{
	int unsigned long a = 1;
	int n;
	int unsigned long array[100000] = {};

	scanf("%d", &n);

	for (int i = 0; i < n; i++)
	{
		scanf("%d", &array[i]);
	}

	for (int i = 0; i < n; i++)
	{
		a = a * array[i];
	}

	if (a > 1000000000000000000)
	{
		printf("-1");
	}
	else
	{
		printf("%ld", a);
	}

	return 0;
}