#include <stdio.h>

int main(void) {
	int N, c = 0;
	unsigned long long a, ans = 1;

	scanf("%d", &N);

	for (int i = 0; i < N; i++) {
		scanf("%llu", &a);

		if (a == 0) {
			printf("0");
			return 0;
		}

		if ((1000000000000000000 / ans) < a) {
			c = 1;
		}
		else {
			ans = ans * a;
		}

		if (ans > 1000000000000000000ULL) {
			c = 1;
		}
		else {
			ans = ans * a;
		}
	}

	if ((ans > 1000000000000000000ULL) || (c > 0)) {
		printf("-1");
		return 0;
	}
	else {
		printf("%llu", ans);
		return 0;
	}

}
