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

(0...N-2).each do |i|
  if D[i][0] == D[i][1] &&  D[i+1][0] == D[i+1][1] && D[i+2][0] == D[i+2][1]
    puts "Yes"
    exit
  end
end

puts "No"