﻿ Codeforces Round #275 (Div. 1)B（线段树+位运算）_html/css_WEB-ITnose-前端-比特在线

### Codeforces Round #275 (Div. 1)B（线段树+位运算）_html/css_WEB-ITnose

B. Interesting Array

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

We'll call an array of n non-negative integers a,?a,?...,?a[n] interesting, if it meets m constraints. The i-th of the m constraints consists of three integers li, ri, qi (1?≤?li?≤?ri?≤?n) meaning that value should be equal to qi.

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?≤?105, 1?≤?m?≤?105) ? the number of elements in the array and the number of limits.

Each of the next m lines contains three integers li, ri, qi (1?≤?li?≤?ri?≤?n, 0?≤?qi?

Output

If the interesting array exists, in the first line print "YES" (without the quotes) and in the second line print n integers a,?a,?...,?a[n](0?≤?a[i]?

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

Sample test(s)

input

`3 11 3 3`

output

`YES3 3 3`

input

`3 21 3 31 3 2`

output

`NO`