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

(0..N-3).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]
    ans += 1
  end
end

if ans > 0
  puts 'Yes'
else
  puts 'No'
end