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