Scheduling

아직 제출이 없습니다시간 제한1초메모리 제한256 MB

문제

Byteasar celebrates his thirteenth birthday. One of the gifts from his parents is a brand new computer! He hastily unwrapped his gift and started reading the computer's manual. It turned out that the computer has mm processors. Byteasar is very happy -- at last he is able to execute many tasks in parallel!

He swiftly prepared a list of nn tasks (numbered 11 through nn) that he plans to execute on his new computer. A processor can execute no more than a single task at once. Task ii takes c_ic\_i seconds to complete and it is forbidden to start its execution less than p_ip\_i seconds since the gift's unwrapping  or complete it later than k_ik\_i seconds after the gift's unwrapping. Every task's execution can be interrupted arbitrarily many times and it can be moved between different processors. However, it cannot be executed on two or more processors simultaneously. Moving a task between processors takes negligible time. Is it possible to schedule the execution of tasks so that each task is executed and completed within its timeframe? In other words, does there exist a strategy of starting, interrupting and moving tasks between processors that would allow Byteasar achieve his goal?

입력

The first line of the input contains two integers nn and mm (1n,m1001 \le n, m \le 100) denoting the number of tasks and the number of processors, respectively. The following nn lines describe Byteasar's tasks. ii-th of them contains a description of task ii: three integers p_ip\_i, k_ik\_i and c_ic\_i (0p_i<k_i106;1c_ik_ip_i0 \le p\_i < k\_i \le 10^6; 1 \le c\_i \le k\_i - p\_i) denoting the beginning and the end of the time interval when it is allowed to execute the ii-th task (expressed in seconds since the gift's unwrapping), and the time it takes to complete this task, respectively.

출력

If it is possible to complete all the tasks within their respective timeframes, print YES. Otherwise, print NO.