Diversity Street

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

문제

A building company wants to build nn houses on a new street. Due to requirements of increasing diversity of the city skyline, all houses must have different heights from 11 to nn floors. Moreover, there are mm additional restrictions on minimum height of buildings on certain intervals of the street. Due to importance of the new street, city administration is ready to cancel one of the restrictions. Determine whether it is possible to create a plan for the new street under the given constraints.

입력

The first line contains two integers: the length of the street nn and the number of height restrictions mm (2n31052 \le n \le 3 \cdot 10^5, 1m31051 \le m \le 3 \cdot 10^5).

The next mm lines contain restrictions. Each restriction is described by three integers hh, ss, and ff which mean that houses from ss to ff inclusively must have height at least hh (2hn2 \le h \le n, 1sfn1 \le s \le f \le n).

출력

If it is not possible to create a street plan, print "NO" on a single line.

Otherwise, on the first line, print "YES". On the second line, print a street plan consisting of nn house heights. The plan must satisfy all restrictions except possibly one. If there are several possible plans, print any one of them.