#SGM0000041. Mảng thú vị (Interesting Array)

Mảng thú vị (Interesting Array)

Interesting Array

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Construct a non-negative integer array whose bitwise AND on every constrained range equals the required value, or report impossibility.

Input

The first line contains n,mn,m. Each of the next mm lines contains li,ri,qil_i,r_i,q_i, requiring $a_{l_i}\mathbin{\&}a_{l_i+1}\mathbin{\&}\cdots\mathbin{\&}a_{r_i}=q_i$.

Output

Print NO if no array exists. Otherwise print YES and then nn values satisfying every constraint. Multiple answers are allowed and are checked by a special checker.

Subtasks

  • 20 points: n,m≤50n,m\le50.
  • 30 points: n,m≤5000n,m\le5000.
  • 50 points: n,m≤105n,m\le10^5, 0≤qi<2300\le q_i<2^{30}, 0≤ai<2300\le a_i<2^{30}.

Examples

Input

3 1
1 3 3

Output

YES
3 3 3

Explanation

The only constraint requires the AND of all three positions to be 3. Array 3 3 3 is valid because 3&3&3=33\mathbin{\&}3\mathbin{\&}3=3. Other valid arrays may also exist.