N = gets.to_i G = N.times.map { gets.split.map(&:to_i) } if G.any? { |v, w| w == 1 } puts "Yes" else puts "No" end