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