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