B = Array.new(10){ Array.new(10) } B[2][8] = 'A' B[3][9] = 'B' B[7][9] = 'C' N = gets.to_i N.times do sx,sy,tx,ty = gets.split.map(&:to_i) B[tx][ty] = B[sx][sy] B[sx][sy] = nil end puts [B[5][8] == 'A', B[4][8] == 'B', B[6][8] == 'C'].all? ? 'Yes' : 'No'