output_description: If it is possible to arrange the pieces under the conditions, print `YES`; if
  it is impossible, print `NO`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N H
      A_1 B_1 C_1 D_1
      A_2 B_2 C_2 D_2
      :
      A_N B_N C_N D_N
attempt: int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  print("YES")
problem_description: Statement
  
  We have N irregular jigsaw pieces. Each piece is composed of three rectangular
  parts of width 1 and various heights joined together. More specifically:
  
    * The i-th piece is a part of height H, with another part of height A_i joined to the left, and yet another part of height B_i joined to the right, as shown below. Here, the bottom sides of the left and right parts are respectively at C_i and D_i units length above the bottom side of the center part.
  
  ![](https://atcoder.jp/img/agc017/2b6cd7f4500d3621bc18de407f167522.png)
  
  Snuke is arranging these pieces on a square table of side 10^{100}. Here, the
  following conditions must be held:
  
    * All pieces must be put on the table.
    * The entire bottom side of the center part of each piece must touch the front side of the table.
    * The entire bottom side of the non-center parts of each piece must either touch the front side of the table, or touch the top side of a part of some other piece.
    * The pieces must not be rotated or flipped.
  
  Determine whether such an arrangement is possible.
samples: [{"input": "3 4\n    1 1 0 0\n    2 2 0 1\n    3 3 1 0", "output": "YES\n    \n\nThe figure below shows a possible arrangement.\n\n![](https://atcoder.jp/img/agc017/27db184b6924d4cec5077a54b505706a.png)\n\n* * *"}, {"input": "4 2\n    1 1 0 1\n    1 1 0 1\n    1 1 0 1\n    1 1 0 1", "output": "NO\n    \n\n* * *"}, {"input": "10 4\n    1 1 0 3\n    2 3 2 0\n    1 2 3 0\n    2 1 0 0\n    3 2 0 2\n    1 1 3 0\n    3 2 0 0\n    1 3 2 0\n    1 1 1 3\n    2 3 0 0", "output": "YES"}]