#include <stdio.h>
 
int main(void) {
	int N = 0;
	unsigned long long a[100000] = { 0 };
	unsigned long long ans = 1;
 
	scanf("%d", &N);
 
	for (int i = 0; i < N; i++) {
		scanf("%llu", &a[i]);
		if (a[i] == 0) {
			printf("0");
			return 0;
		}
	}
 
	for (int i = 0; i < N; i++) {
		ans = ans * a[i];
		if (ans > 1000000000000000000) {
			printf("-1");
			return 0;
		}
	}
  
	printf("%llu", ans);
 
	return 0;
}