#include<stdio.h>
#include<stdlib.h>
#include<math.h>
long long int arr[10]
int main()
{
	int k,i,flag=1,flag1=0;
	long long int data,res1=1;
	scanf("%d",&k);
	for(i=0;i<k;++i)
	{
		scanf("%lld",&data);
		if(data==0)
			flag1=1;
		if(res1<=10000000000000000000/data)
			res1=res1*data;
		else
			flag=0;
	}
	if(flag1)
	{
		printf("0\n");
		return;
	]
	else if(flag)
		printf("%lld\n",res);
	else
		printf("-1\n");
	return 0;
}
			
		
