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.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @author Don Li
 */
public class InterestingArray {

    static final int INF = (1 << 30) - 1;

    void solve() {
        int n = in.nextInt(), m = in.nextInt();

        int[] l = new int[m], r = new int[m], q = new int[m];
        for (int i = 0; i < m; i++) {
            l[i] = in.nextInt() - 1;
            r[i] = in.nextInt();
            q[i] = in.nextInt();
        }

        int[] res = new int[n];
        for (int i = 0; i < 30; i++) {
            int[] ps = new int[n + 1];
            for (int j = 0; j < m; j++) {
                if (((q[j] >> i) & 1) == 1) {
                    ps[l[j]]++;
                    ps[r[j]]--;
                }
            }
            for (int j = 1; j < n; j++) {
                ps[j] += ps[j - 1];
            }
            for (int j = 0; j < n; j++) {
                if (ps[j] > 0) res[j] |= 1 << i;
            }
        }

        SegmentTree st = new SegmentTree(res);
        for (int i = 0; i < m; i++) {
            if (st.query(l[i], r[i]) != q[i]) {
                out.println("NO");
                return;
            }
        }

        out.println("YES");
        for (int i = 0; i < n; i++) {
            if (i > 0) out.print(' ');
            out.print(res[i]);
        }
        out.println();
    }

    static class SegmentTree {
        int n;
        int[] d;

        SegmentTree(int[] a) {
            int m = a.length;
            int x = 0;
            while ((1 << x) < m) x++;
            n = 1 << x;
            d = new int[2 * n - 1];

            for (int i = 0; i < n; i++) {
                if (i < m) d[n - 1 + i] = a[i];
                else d[n - 1 + i] = INF;
            }
            for (int i = n - 2; i >= 0; i--) {
                d[i] = d[2 * i + 1] & d[2 * i + 2];
            }
        }

        int query(int a, int b) {
            return query(a, b, 0, 0, n);
        }

        int query(int a, int b, int k, int l, int r) {
            if (a >= r || b <= l) return INF;
            if (a <= l && r <= b) return d[k];
            return query(a, b, 2 * k + 1, l, (l + r) / 2) & query(a, b, 2 * k + 2, (l + r) / 2, r);
        }
    }

    public static void main(String[] args) {
        in = new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(System.out);
        new InterestingArray().solve();
        out.close();
    }

    static FastScanner in;
    static PrintWriter out;

    static class FastScanner {
        BufferedReader in;
        StringTokenizer st;

        public FastScanner(BufferedReader in) {
            this.in = in;
        }

        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextToken());
        }

        public long nextLong() {
            return Long.parseLong(nextToken());
        }

        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}
