#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>

#define N 100000

int main(void) {
	double A[N];
	double Ans;
	int n;
	Ans = 1;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%lf", &A[i]);
		Ans *= A[i];
	}
	if (Ans < pow(10, 18))
		printf("%d", (int)Ans);
	else printf("-1");
}