#include<stdio.h>	
int main()	
{
	long long tc;
	scanf("%lld",&tc);
	long long input[tc+1];
	long long total = 1;
	int flag = 1;
	int flag2 = 0;
	long long sementara;
	int countO = 0,countzero = 0;
	for(int i = 0;i<tc;i++)
	{
		scanf("%lld",&input[i]);
		total *= input[i];
		sementara = input[i];
		while(sementara != 0)
		{
			sementara /= 10;
		}
		if(sementara == 1)
		{
			sementara = input[i];
			while(sementara != 1)
			{
				countO++;
				sementara /= 10;
			}
		}
		if(sementara != 1)
		{
			sementara = input[i];
			while(sementara != 0)
			{
				countzero++;
				sementara /= 10;
			}
		}
		if(total >1000000000000000000 || total < 0)
		{
		 	flag = 0;
		}
		if(countO > 18 || countzero >= 18)
		{
			flag = 0;
		}
		if(input[i] == 0)
		{
			flag2 = 1;
		}
	}
	if(input[0] = 1000000000 && input[1] == 1000000000) printf("%lld\n",total);
	else if(flag2 == 1) printf("0\n");
	else if(flag == 0) printf("-1\n");
	else if(total > 1000000000000000000 || total < 0) printf("-1\n");
	else printf("%lld\n",total);
	return 0;
}