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
/*
 ID: govind.3, GhpS, govindpatel
 LANG: JAVA
 TASK: Main 
 */

import java.io.*;
import java.util.*;

public class Main {

    private int BIT = 30;
    private int MAX = 1000 * 1000;//10^6
    private int[] tree = new int[4 * MAX];
    private int[] values = new int[MAX];
    int[] sum = new int[MAX];

    private void build(int v, int tl, int tr) {//v=1 => root, tl=0 => values.sIndex, tr=N-1 => values.length-1
        if (tl + 1 == tr) {
            tree[v] = values[tl];
        } else {
            int tm = (tl + tr) >> 1;
            build(2 * v, tl, tm);//left
            build(2 * v + 1, tm, tr);//right
            tree[v] = tree[v * 2] & tree[v * 2 + 1];
        }
    }

    private int AND(int v, int tl, int tr, int l, int r) {
        if (l == tl && r == tr) {
            return tree[v];
        }
        int tm = (tl + tr) >> 1;
        int ans = (1 << BIT) - 1;
        if (l < tm) {
            ans = ans & AND(2 * v, tl, tm, l, Math.min(r, tm));
        }
        if (tm < r) {
            ans = ans & AND(2 * v + 1, tm, tr, Math.max(l, tm), r);
        }

        return ans;
    }

    private void solve() throws IOException {
        StringBuilder sb = new StringBuilder("");
        int N = nextInt();
        int M = nextInt();
        int[][] query = new int[M][];
        //int[] sum = new int[MAX];//new int[N + 1];

        for (int i = 0; i < M; i++) {
            query[i] = new int[]{nextInt(), nextInt(), nextInt()};//(l,r) - q
            --query[i][0];
        }

        for (int bit = 0; bit <= BIT; bit++) {
            Arrays.fill(sum, 0);
            for (int i = 0; i < M; i++) {
                if (((query[i][2] >> bit) & 1) != 0) {
                    sum[query[i][0]]++;
                    sum[query[i][1]]--;
                }
            }
            for (int i = 0; i < N; i++) {
                if (i > 0) {
                    sum[i] += sum[i - 1];
                }
                if (sum[i] > 0) {//set this bit;
                    values[i] = (values[i] | (1 << bit));
                }
            }
        }
        //System.out.println(Arrays.toString(values));
        build(1, 0, N);

        for (int i = 0; i < M; i++) {
            if (AND(1, 0, N, query[i][0], query[i][1]) != query[i][2]) {
                System.out.println("NO");
                return;
            }
        }
        sb.append("YES\n");
        for (int i = 0; i < N; i++) {
            sb.append(values[i]);
            if (i != N - 1) {
                sb.append(" ");
            }
        }
        System.out.println(sb);
    }

    public static void main(String[] args) {
        new Main().run();
    }

    public void run() {
        try {
            in = new BufferedReader(new FileReader("Main.in"));
            out = new PrintWriter(new BufferedWriter(new FileWriter("Main.out")));
            tok = null;
            solve();
            in.close();
            out.close();
            System.exit(0);
        } catch (IOException e) {//(FileNotFoundException e) {
            try {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(new OutputStreamWriter(System.out));
                tok = null;
                solve();
                in.close();
                out.close();
                System.exit(0);
            } catch (IOException ex) {
                System.out.println(ex.getMessage());
                System.exit(0);
            }
        }
    }

    private String nextToken() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    private long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    private double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
    BufferedReader in;
    StringTokenizer tok;
    PrintWriter out;
}
