#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main(void) {

	int n, i;
	unsigned long a[100005];
	unsigned long long product=1;

	scanf("%d", &n);

	for (i = 0; i < n; i++) {
		scanf("%llu", &a[i]);
		product *= a[i];
		if (product > 1000000000000000000) {
			product = -1;
			break;
		}
	}

	printf("%llu", product);

	return 0;
}