n = gets.to_i
d = Array.new(n){gets.split.map(&:to_i)}

ans = 'No'

(n-2).times{|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]
          ans = 'Yes'
        end
      end
  end
  }
puts ans