N = STDIN.gets.chomp.to_i

count = 0
yes = false

for i in 1..N do
    a, b = STDIN.gets.chomp.split(' ')
    if a == b
        count += 1
        if count == 3
            yes = true
        end
    else
        count = 0
    end
end

if yes
    puts 'yes'
else
    puts 'no'
end
