#### Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

### Title

### Problem Statement

There are `N` people standing on the `x`-axis.
Let the coordinate of Person `i` be `x _{i}`.
For every

`i`,

`x`is an integer between

_{i}`0`and

`10`(inclusive). It is possible that more than one person is standing at the same coordinate.

^{9}You will given `M` pieces of information regarding the positions of these people.
The `i`-th piece of information has the form `(L _{i}, R_{i}, D_{i})`.
This means that Person

`R`is to the right of Person

_{i}`L`by

_{i}`D`units of distance, that is,

_{i}`x`holds.

_{Ri}- x_{Li}= D_{i}It turns out that some of these `M` pieces of information may be incorrect.
Determine if there exists a set of values `(x _{1}, x_{2}, ..., x_{N})` that is consistent with the given pieces of information.

### Constraints

`1 ≤ N ≤ 100``000``0 ≤ M ≤ 200``000``1 ≤ L`(_{i}, R_{i}≤ N`1 ≤ i ≤ M`)`0 ≤ D`_{i}≤ 10`000`(`1 ≤ i ≤ M`)`L`(_{i}≠ R_{i}`1 ≤ i ≤ M`)- If
`i ≠ j`, then`(L`and_{i}, R_{i}) ≠ (L_{j}, R_{j})`(L`._{i}, R_{i}) ≠ (R_{j}, L_{j}) `D`are integers._{i}

### Input

Input is given from Standard Input in the following format:

NML_{1}R_{1}D_{1}L_{2}R_{2}D_{2}:L_{M}R_{M}D_{M}

### Output

If there exists a set of values `(x _{1}, x_{2}, ..., x_{N})` that is consistent with all given pieces of information, print

`Yes`

; if it does not exist, print `No`

.### Sample Input 1

3 3 1 2 1 2 3 1 1 3 2

### Sample Output 1

Yes

Some possible sets of values `(x _{1}, x_{2}, x_{3})` are

`(0, 1, 2)`and

`(101, 102, 103)`.

### Sample Input 2

3 3 1 2 1 2 3 1 1 3 5

### Sample Output 2

No

If the first two pieces of information are correct, `x _{3} - x_{1} = 2` holds, which is contradictory to the last piece of information.

### Sample Input 3

4 3 2 1 1 2 3 5 3 4 2

### Sample Output 3

Yes

### Sample Input 4

10 3 8 7 100 7 9 100 9 8 100

### Sample Output 4

No

### Sample Input 5

100 0

### Sample Output 5

Yes

### Tags

### Subtasks and Limits

Subtask | Score | #TC | Time | Memory | Scoring |
---|---|---|---|---|---|

1 | 100 | 42 | 1s | 256MB | Minimum |

2 | 0 | 5 | 1s | 256MB | Minimum |

### Judge Compile Command

g++-8 ans.cpp -o line -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512