#include <stdio.h>

int main(void) {
	int N = 0;
	unsigned long long a[100000];
	unsigned long long ans = 1;
	int c = 0;

	scanf("%d", &N);

	for (int i = 0; i < N; i++) {
		scanf("%llu", &a[i]);
	
		if (a[i] == 0) {
			printf("0");
			return 0;
		}
		if (ans > 1000000000000000000) {
			c++;
		}
		else {
			ans = ans * a[i];
		}
	}

	if (ans > 1000000000000000000) {
		c++;
	}

	if (c > 0) {
		printf("-1");
		return 0;
	}
	else {
		printf("%llu", ans);
	}

	return 0;
}