#include <stdio.h>

int main() {
	int n;
	long long a[100000], output = 1;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)scanf("%lld", &a[i]);
	for (int i = 0; i < n; i++)output *= a[i];
	if (output > 1000000000000000000)printf("-1");
	else printf("%lld", output);
	return 0;
}