Question
Gathering Spots
In a vibrant community, a resourceful organizer named "Sam" was preparing for a large event. He had x available gathering spots in a designated area. Sam received a list of n activities, each described by three numbers: m (the number of participants), u (the starting position in meters), and v (the ending position in meters).
Sam's task was to determine if he could accommodate all participants for each activity without exceeding the available gathering spots at any moment. If he could manage to host all the activities successfully, he would announce "Yes"; otherwise, he would say "No".
Input
The first line of the input contains two space-separated integers n and x denoting the number of trips and capacity.
The following n line contains 3 space-separated integers m, u, and v denoting the activities
Constraints
1 ≤ n ≤ 1000
1 ≤ x ≤ 105
1 ≤ m ≤ 100
1 ≤ u, v ≤ 1000
The following n line contains 3 space-separated integers m, u, and v denoting the activities
Constraints
1 ≤ n ≤ 1000
1 ≤ x ≤ 105
1 ≤ m ≤ 100
1 ≤ u, v ≤ 1000
Output
Print "Yes" (without quotes) if it's possible to manage to host all the activities successfully, given otherwise "No".
Example
Sample Input
2 4
2 1 5
3 3 7
Sample Output
No
Explanation
From position 1 to 5, there will be 2 participants. At position 3, 3 more participants will join, making the total number of participants 5. Since the available gathering spots are only 4, it is not possible to accommodate everyone.
2 4
2 1 5
3 3 7
Sample Output
No
Explanation
From position 1 to 5, there will be 2 participants. At position 3, 3 more participants will join, making the total number of participants 5. Since the available gathering spots are only 4, it is not possible to accommodate everyone.