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.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.*;
import java.io.InputStream;

public class Solution {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);

        Task solver = new Task();
        solver.solve(in, out);

        out.close();
    }
}

/*
 *     Solution
 */
class Question{
    int l;
    int r;
    long g;
    Question(int l, int r, long g) {
        this.l = l-1;
        this.r = r-1;
        this.g = g;
    }
}

class Task {

    long[] tree;
    public void solve(InputReader in, PrintWriter out) {

        int n = in.nextInt();
        int m = in.nextInt();

        Question[] q = new Question[m];
        for (int i = 0; i < m; i++) {
            q[i] = new Question(in.nextInt(), in.nextInt(), in.nextLong());
        }

        tree = new long[4*n];
        for (int i = 0; i < m; i++) {
            update(1, 0, n-1, q[i].l, q[i].r, q[i].g);
        }

        /*
        {
            int c = 2;
            int i = 1;
            while (i < 4 * n) {
                out.print(tree[i] + " ");
                i++;
                if (i == c) {
                    c *= 2;
                    out.println();
                }

            }
        }
        out.println();
        out.println();
        */

        for (int i = 0; i < m; i++) {
            if (qwestion(1, 0, n-1, q[i].l, q[i].r) != q[i].g) {
                 out.println("NO");
                return;
            }
           // out.println(i+1 + " " + q[i].g + " " + qwestion(1, 0, n-1, q[i].l, q[i].r));

        }
        out.println("YES");
        for (int i = 0; i < n; i++) {
            out.print(qwestion(1, 0, n-1, i, i) + " ");
        }
        return;
    }

    private void update(int v, int tLeft, int tRight, int l, int r, long q) {

        if (l > r) return;

        if (l == tLeft && r == tRight) {
            tree[v] |= q;
            return;
        }

        int tMedium = (tLeft + tRight) / 2;
        update (v*2,   tLeft,     tMedium, l,                     Math.min(r,tMedium), q);
        update (v*2+1, tMedium+1, tRight,  Math.max(l,tMedium+1), r,                   q);
        tree[v] |= (tree[v*2] & tree[v*2+1]);
    }

    private long qwestion(int v, int tLeft, int tRight, int l, int r) {

        if (l > r) return (1 << 30) - 1;

        if (l == tLeft && r == tRight) {
            return tree[v];
        }

        int tMedium = (tLeft + tRight) / 2;
        return   tree[v] |  (qwestion(v*2, tLeft, tMedium, l, Math.min(r,tMedium)) &
                             qwestion(v*2+1, tMedium+1, tRight, Math.max(l,tMedium+1), r));
    }
}



/*
 *      Reading
 */

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader (InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong() {
        return Long.parseLong(next());
    }
    public double nextDouble() {
        return Double.parseDouble(next());
    }

}