We'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 li, ri, qi (1 ≤ li ≤ ri ≤ n) meaning that value <image> 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 < 230) 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] < 230) 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
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Stack;

public class Main {

    static final int SIZE = (int) Math.pow(2, 17);
    static final int MAX_VAL_LOG = 32;
    static int[] l = new int[SIZE];
    static int[] r = new int[SIZE];
    static int[] q = new int[SIZE];
    static int[][] seq = new int[MAX_VAL_LOG][SIZE];
    static int[] t = new int[SIZE*2]; 
    
    public static void insert(int val, int index, int l, int r, int pos) {
        if (l == r) {
            t[index] = val;
//          System.out.println("inserted: " + pos + " on position " + index + " begin: " + l + " end: " + r);
//          System.out.println(Arrays.toString(t));
            return;
        }
//      System.out.println("next call: " + l + " " + r + " index: "+ index);
        int mid = (l+r)/2;
        if (mid >= pos) insert(val, index*2, l, mid, pos);
        else insert(val, index*2+1, mid+1, r, pos);
        t[index] = t[index*2] & t[index*2+1];
//      if (t[index] != 0) System.out.println("& " + index + " " + index*2 + " " + (index*2+1) + " begin: " + l + " " + " end:" + r);
    }
    
    public static int query(int index, int L, int R, int l, int r) {
        if (l==L && R==r) {
            return t[index];
        }
        int mid = (l+r)/2;
        int result = (1<<31) - 1;
//      System.out.println("result before: " + result);
        if (mid >= L) {
            int a = query(index*2, L, Math.min(mid, R), l, mid);
//          System.out.println("left query result: " + a);
            result &= a;
//          System.out.println("result & left query: " + result);
        }
        if (R > mid) {
            int a = query(index*2+1, Math.max(mid+1, L), R, mid+1,r);
//          System.out.println("right query result: " + a);
            result &= a;
//          System.out.println("result & right query: " + result);
        }
            
        return result;
    }

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        String[] values = line.split(" ");
        int n = Integer.parseInt(values[0]);
        int m = Integer.parseInt(values[1]);
        for (int i = 0; i < m; i++) {
            line = br.readLine();
            values = line.split(" ");
            l[i] = Integer.parseInt(values[0]);
            r[i] = Integer.parseInt(values[1]);
            q[i] = Integer.parseInt(values[2]);
            for (int j = 0; j < MAX_VAL_LOG; j++) {
                if ((q[i] >> j & 1) == 1) {
                    seq[j][l[i]]++; seq[j][r[i]+1]--;
                }
            }
        }
        int[] sum = new int[MAX_VAL_LOG];
        for (int j = 0; j < SIZE; j++) {
            int val = 0;
            for (int i = MAX_VAL_LOG-1; i >= 0; i--) {
                val <<= 1;
                sum[i] += seq[i][j];
                val += (sum[i] > 0) ? 1 : 0;
            }
            if (val > 0) {//System.out.println(j);
            insert(val, 1, 1, SIZE,j);}
        }
//      System.out.println("___________________________________________________________");
        for (int i = 0; i < m; i++) {
            if (query(1, l[i], r[i], 1, SIZE) != q[i]) {
                System.out.println("NO");
                return;
            }
        }
        System.out.println("YES");
        int index = SIZE;
        for (int i = 0; i < n; i++) {
            System.out.print(t[index] + " ");
            index++;
        }
    }
}

