#include<stdio.h>

int main(void)
{
	int N;
	unsigned long long int sum;
	unsigned long long int A;
	scanf("%d",&N);
	scanf("%lld", &sum);
	for (int i = 1;i < N;i++) {
		scanf("%lld", &A);
		if (A > 1000000000000000000) {
			printf("-1");
			return 0;
		}
		sum *= A;
		if (sum > 1000000000000000000) {
			printf("-1");
			return 0;
		}
	}
	printf("%lld",sum);

	return 0;
}