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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashMap;
import java.awt.Point;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            int[] a = new int[n];
            int[][] bit = new int[n + 1][30];
            HashMap<Point, Integer> map = new HashMap<>();
            for (int i = 0; i < m; i++) {
                int l = in.nextInt() - 1;
                int r = in.nextInt() - 1;
                int q = in.nextInt();
                Integer tmp = map.get(new Point(l, r));
                if (tmp != null && tmp != q) {
                    out.println("NO");
                    return;
                }
                map.put(new Point(l, r), q);
                for (int j = 0; (1 << j) <= q; j++) {
                    if ((q & (1 << j)) != 0) {
                        bit[l][j]++;
                        bit[r + 1][j]--;
                    }
                }
            }
            int[][] sum = new int[n + 1][30];
            for (int j = 0; j < 30; j++) {
                if (bit[0][j] != 0) {
                    sum[0][j] = 1;
                    a[0] |= (1 << j);
                } else
                    sum[0][j] = 0;
            }
            for (int i = 1; i < n; i++)
                for (int j = 0; j < 30; j++) {
                    bit[i][j] += bit[i - 1][j];
                    if (bit[i][j] != 0) {
                        a[i] |= (1 << j);
                        sum[i][j] = sum[i - 1][j] + 1;
                    } else
                        sum[i][j] = sum[i - 1][j];
                }
            ArrayList<Point> tmp = new ArrayList<>(map.keySet());
            for (Point p : tmp) {
                int q = map.get(p);
                for (int j = 0; (1 << j) <= q; j++) {
                    int s = 0;
                    if (p.x != 0)
                        s = sum[p.y][j] - sum[p.x - 1][j];
                    else
                        s = sum[p.y][j];
                    if ((q & (1 << j)) == 0 && s == p.y - p.x + 1) {
                        out.println("NO");
                        return;
                    } else if ((q & (1 << j)) != 0 && p.y - p.x + 1 != s) {
                        out.println("NO");
                        return;
                    }
                }
            }
            out.println("YES");
            for (int i = 0; i < n; i++)
                out.print(a[i] + (i == n - 1 ? "\n" : " "));
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[16384];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}

