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