- Time limit: 1.00 s
- Memory limit: 512 MB
Your task is to construct an array consisting of integers.
The array must satisfy constraints of the form : the sum must equal .
Input
The first line has two integers and : the length of the array and the number of constraints.
The next lines each have three integers , and : the description of the constraints.
Output
If a solution exists, print YES
on the first line.
On the second line, print integers : the contents of the array. All elements of the array must satisfy and the array must satisfy all given constraints. You can print any valid solution.
If no solution exists, just print NO
.
Constraints
Example
Input:
5 3 1 3 3 3 5 3 4 4 -1
Output:
YES 0 2 1 -1 3