#include <stdio.h>

#define LIM 1000000000000000000

long long int arr[100000];

int main(void) {
	int n;
	scanf("%d", &n);

	for (int i = 0; i < n; i++) {
		scanf("%lld", &arr[i]);
		if (arr[i] == 0) {
			puts("0");
			return 0;
		}
	}

	long long int p = 1;
	for (int i = 0; i < n; i++) {
		if (p > LIM/arr[i]) {
			puts("-1");
			return 0;
		}
		p *= arr[i];
	}
	printf("%lld\n", p);
}
