#include<stdio.h>
int main()
{
	long long n,input,max = 1e18,flag = 0,zero = 0,total = 1;
	scanf("%lld",&n);
	while(n--)
	{
		scanf("%lld",&input);
		flag = (input > max) ? 1 : flag;
		total *= input; 
		if(input == 0) zero = 1;
		else max /= input;
	}
	(zero == 1) ? printf("0\n") : (flag == 1) ? 
}