#include <stdio.h>

int main(void) {
	int N = 0;
	unsigned long int a[100000] = { 0 };
	unsigned long int ans = 1;

	scanf("%lu", &N);

	for (int i = 0; i < N; i++) {
		scanf("%ld", &a[i]);
		if (a[i] == 0) {
			printf("0");
			return 0;
		}
	}

	for (int i = 0; i < N; i++) {
		ans = ans * a[i];
		if (ans > 1000000000000000000) {
			printf("-1");
			return 0;
		}
	}
	printf("%lu", &ans)
}