#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)
		{
			if(sementara % 10 == 0) countO++;
			if(sementara > 9) countzero++;
			sementara /= 10;
		}
		if(total >1000000000000000000 || total < 0)
		{
		 	flag = 0;
		 	break;
		}
		if(countO > 18 || countzero >= 18)
		{
			flag = 0;
			break;
		}
		if(input[i] == 0)
		{
			flag2 = 1;
			break;
		}
	}
	if(flag2 == 1) printf("0\n");
	else if(flag == 0) printf("-1\n");
	else if(total > 1000000000000000000) printf("-1\n");
	else printf("%lld\n",total);
	return 0;
}	