#include<stdio.h>
#define MAX 1000000000000000000
void main()
{
	int inputConf;
	double n;
	double max;
	double a, b;
	double ans = 1;
	inputConf = scanf("%lf", &n);

	for (long i = 0; i < n; i++) {
		inputConf = scanf("%lf", &a);
		ans *= a;
	}
	if (ans >= MAX) {
		printf("%d", -1);
	}
	else {
		printf("%.0lf", ans);
	}

}