#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main(void) {

	int n;
	long long a[100005];
	long long product=1, b = 10000000000000000000;

	scanf("%d", &n);

	for (int i = 0; i < n; i++) {
		scanf("%lld", &a[i]);

			if (b / product < a[i]) {
			product = -1;
			break;
		    }

			if (a[i] == 0) { printf("0"); return 0; }

		product *= a[i];
	
	}

	printf("%lld", product);

	return 0;
}