#include <stdio.h>
typedef long long ll;
int main() {
	int n;
	ll ans = 1, a[100000];
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%lld", &a[i]);
		if (a[i] == 0) {
			printf("0\n");
			return 0;
		}
	}
	for (int i = 0; i < n; i++) {
		if (a[i] <= 1000000000000000000 / ans) {
			ans *= a[i];
		} else {
			ans = -1;
			break;
		}
	}
	printf("%lld\n", ans);
	return 0;
}