#include <stdio.h>

#define MAXNUM 1000000000000000000

int main(void) {
	unsigned int n;
	unsigned long int a, prod = 1;
	unsigned char flag = 0;
	
	scanf("%u", &n);

	for (size_t i = 0; i < n; i++) {
		scanf("%lu", &a);
		
		unsigned long int q;
		if (a == 0) {
			flag = 0;
			prod = 0;
			break;
		} else if (prod > (q = MAXNUM / a)) {
			flag = 1;
		}
		
		if (flag == 0) {
			prod *= a;
		}
	}

	switch (flag) {
		case 0:
			printf("%lu\n", prod);
			break;
		case 1:
			printf("%d\n", -1);
			break;
		default:
			// nothing to do
			break;
	}

	return 0;

}
