#include<stdio.h>
int main()
{
	int tc;
	scanf("%d",&tc);
	long long input,max = 1e18,sum = 1;
	int zero = 0, flag = 0;
	for(int i = 0;i<tc;i++)
	{
		scanf("%lld",&input);
		flag = (input > max) ? 1 : flag;
		sum *= input;
		input == 0 ? zero = 1 : max /= input;
	}
	zero == 1 ? printf("0\n") : (flag == 1) ? printf("-1\n") : printf("%lld\n",sum);
	return 0; 
}