#include<stdio.h>

int main(void)
{
	unsigned long long int a, b, c = 1, d = 0;
	int i;

	scanf("%lld", &a);

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

		if (d != 1) {
			if (18 < log10(b) + log10(c)) {
				d = 1;
			}
			else if (1000000000000000000 <= c * b) {
				d = 1;
			}
		}

		else if (b == 0) {
			d = 0;
		}
		c = c * b;
	}

	if (d == 0) {
		printf("%lld", c);
	}

	else {
		printf("-1");
	}


	return 0;
}