#include <stdio.h>
#define MAX 1000000000000000000

int main(void) {
	int n, a;
	int total = 1;
	int i;

	scanf("%d", &n);

	for (i = 0; i < n; i++) {
		scanf("%d", &a);
		total *= a;
		if (total >= MAX) {
			total = -1;
			break;
		}
	}
	printf("%d", total);

	return 0;
}