#include <stdio.h>

int main(void) {
	int N = 0;
	int tmp = 0;
	unsigned long int ans = 1;

	scanf("%d", &N);

	for (int i = 0; i < N; i++) {
		scanf("%d", &tmp);
		if (tmp == 0) {
			printf("0");
			return 0;
		}
		ans = ans * tmp;
	}

	if (ans > 1000000000000000000) {
		printf("-1");
		return 0;
	}

	printf("%ld", ans);

	return 0;
}
