Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

B. Interesting Array

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputWe'll call an array of *n* non-negative integers *a*[1], *a*[2], ..., *a*[*n*] interesting, if it meets *m* constraints. The *i*-th of the *m* constraints consists of three integers *l* _{ i}, *r* _{ i}, *q* _{ i} (1 ≤ *l* _{ i} ≤ *r* _{ i} ≤ *n*) meaning that value should be equal to *q* _{ i}.

Your task is to find any interesting array of *n* elements or state that such array doesn't exist.

Expression *x*&*y* means the bitwise AND of numbers *x* and *y*. In programming languages C++, Java and Python this operation is represented as "&", in Pascal — as "and".

Input

The first line contains two integers *n*, *m* (1 ≤ *n* ≤ 10^{5}, 1 ≤ *m* ≤ 10^{5}) — the number of elements in the array and the number of limits.

Each of the next *m* lines contains three integers *l* _{ i}, *r* _{ i}, *q* _{ i} (1 ≤ *l* _{ i} ≤ *r* _{ i} ≤ *n*, 0 ≤ *q* _{ i} < 2^{30}) describing the *i*-th limit.

Output

If the interesting array exists, in the first line print "YES" (without the quotes) and in the second line print *n* integers *a*[1], *a*[2], ..., *a*[*n*] (0 ≤ *a*[*i*] < 2^{30}) decribing the interesting array. If there are multiple answers, print any of them.

If the interesting array doesn't exist, print "NO" (without the quotes) in the single line.

Examples

Input

3 1

1 3 3

Output

YES

3 3 3

Input

3 2

1 3 3

1 3 2

Output

NO

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: May/26/2020 07:25:37 (h3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|