#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

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

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

	for (int i = 0; i < N; i++)
	{
		scanf("%ld ", &L);
		x *= L;
		if (L == 0)
		{
			g = 0;
			break;
		}
		else if (x > 1000000000000000000)
		{
			f = -1;
		}

	}

	printf("%ld", f == 0 ? x*g : f*g );

}