#include<stdio.h>

int main(void)
{
	int N;
	 long long int sum;
 long long int A[100000];
	scanf("%d",&N);

	for (int i = 0;i < N;i++) {
		scanf("%lld", &A[i]);
		if (A[i] > 1000000000000000000) {
			printf("-1");
			return 0;
		}
		if (A[i] == 0) {

				printf("0");
				return 0;
			

		}
	}
	sum = A[0];
	for (int i = 1;i < N;i++) {
		sum *= A[i];
			if (sum > 1000000000000000000) {
				printf("-1");
				return 0;
			}
	}
	printf("%lld",sum);

	return 0;
}