#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main(void)
{
	int N;
	long x = 1,L;

	scanf("%d\n", &N);

	for (int i = 0; i < N; i++)
	{
		scanf("%ld ", &L);
		x *= L;
		if (x == 0)
			break;
	}

	printf("%ld", x <= 1000000000000000000 ? x : -1);

}