gets.to_i.times{puts %q(0 45).include?(gets.chomp) ? :Y : :N}