n = gets.chomp.to_i                                                           
                                                                              
                                                                              
yes_times = 0                                                                 
answer = 'No'                                                                 
                                                                              
n.times do                                                                    
  line = gets.chomp.split(" ").map(&:to_i)                                    
  if line[0] == line[1]                                                       
    yes_times += 1                                                            
  else                                                                        
    yes_times = 0                                                             
  end                                                                         
  if yes_times > 2                                                            
    answer = 'Yes'                                                            
    break                                                                     
  end                                                                         
end                                                                           
print answer