N = gets.to_i
D = N.times.map{gets.split.map(&:to_i)}

count = 0
(N-2).times do |i|
  if D[i][0] == D[i][1]
    if D[i+1][0] == D[i+1][1]
      if D[i+2][0] == D[i+2][1]
    	count += 1
      end
    end
  end
end

if count > 0
  puts "Yes"
else
  puts "No"
end