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

}