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