N = gets.to_i
D = []
while line = gets
  D << line.chomp.split(' ').map(&:to_i)
end

sum = 0
(0..N-1).each do |i|
  if D[i][0] == D[i][1]
    sum += 1
  end
end

if sum >= 3
  puts "Yes"
else
  puts "No"
end