#include <stdio.h>
#include <stdlib.h>
#define MAX 1000000000000000000

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

	if (scanf("%d", &n) < 1) {
		exit(1);
	}

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

	return 0;
}