#K47312. Taco Orders Fulfillment

    ID: 28171 Type: Default 1000ms 256MiB

Taco Orders Fulfillment

Taco Orders Fulfillment

In this problem, you are given a number of orders and a daily production capacity. Each order consists of three integers representing the required quantities of taco ingredients. Your task is to determine whether it is possible to fulfill all the orders without exceeding the daily production capacity.

For each order, if the sum of the three required quantities is greater than the capacity, then the order cannot be fulfilled. Otherwise, if all orders satisfy the production limit, the answer is YES. If at least one order exceeds the limit, the answer is NO.

Note: All formulas, if any, are expressed in \( \LaTeX \) format. In this problem, for an order with quantities \(g\), \(s\), and \(b\), the condition to check is \(g + s + b \leq p\), where \(p\) is the production capacity.

inputFormat

The first line contains two integers \(n\) and \(p\) where \(n\) is the number of orders and \(p\) is the production capacity per day.

Each of the following \(n\) lines contains three integers: \(g\), \(s\), and \(b\), representing the required quantities for that order.

outputFormat

Print a single line: YES if every order can be fulfilled without exceeding the daily production capacity, or NO otherwise.

## sample
3 100
30 20 40
50 30 10
40 35 20
YES