#include<stdio.h>

void main()
{
	int inputConf;
	unsigned long n;
	unsigned long num;
	unsigned long ans = 1;

	inputConf = scanf("%d", &n);
	for (unsigned long i = 0; i < n; i++) {
		inputConf = scanf("%d", &num);
		ans *= num;
	}
	if (1000000000000000000 < ans) {
		printf("%d", -1);
	}
	else {
		printf("%d", ans);
	}
}