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.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class TaskB {
        static int[] ans = new int[100005];
        static int[] segtree = new int[4 * 100005];
        static int[] andtree = new int[4 * 100005];

        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            int ll[] = new int[m];
            int rr[] = new int[m];
            int qq[] = new int[m];

            for (int i = 0; i < m; i++) {
                ll[i] = in.nextInt() - 1;
                rr[i] = in.nextInt() - 1;
                qq[i] = in.nextInt();
                update(0, n - 1, 0, ll[i], rr[i], qq[i]);
            }

            for (int i = 0; i < n; i++)
                ans[i] = getNumber(0, n - 1, 0, i);
            init(0, n - 1, 0);
            boolean check = true;

            for (int i = 0; i < m; i++) {
                if (query(0, n - 1, 0, ll[i], rr[i]) != qq[i]) {
                    check = false;
                    break;
                }
            }

            if (check == true) {
                out.println("YES");
                for (int i = 0; i < n; i++)
                    out.printf("%d ", ans[i]);
                out.println();
            } else
                out.println("NO");
        }

        static void update(int start, int endd, int curr, int l, int r, int q) {

            if (start == l && endd == r) {
                segtree[curr] |= q;
                return;
            }
            int mid = (start + endd) / 2;
            if (l <= mid && r <= mid) {
                update(start, mid, 2 * curr + 1, l, r, q);
                return;
            }

            if (l > mid && r > mid) {
                update(mid + 1, endd, 2 * curr + 2, l, r, q);
                return;
            }

            if (l <= mid && r > mid) {
                update(start, mid, 2 * curr + 1, l, mid, q);
                update(mid + 1, endd, 2 * curr + 2, mid + 1, r, q);
            }
        }

        static int getNumber(int start, int end, int curr, int num) {
            if (start == end) {
                return segtree[curr];
            }

            int mid = (start + end) / 2;
            if (num <= mid) {
                segtree[2 * curr + 1] |= segtree[curr];
                return getNumber(start, mid, 2 * curr + 1, num);
            } else {
                segtree[2 * curr + 2] |= segtree[curr];
                return getNumber(mid + 1, end, 2 * curr + 2, num);
            }
        }

        static void init(int start, int endd, int curr) {
            if (start == endd) {
                andtree[curr] = ans[start];
                return;
            }

            int mid = (start + endd) / 2;
            init(start, mid, 2 * curr + 1);
            init(mid + 1, endd, 2 * curr + 2);
            andtree[curr] = andtree[2 * curr + 1] & andtree[2 * curr + 2];
        }

        static int query(int start, int endd, int curr, int l, int r) {
            if (start == l && endd == r)
                return andtree[curr];

            int mid = (start + endd) / 2;
            if (l <= mid && r <= mid)
                return query(start, mid, 2 * curr + 1, l, r);

            if (l > mid && r > mid)
                return query(mid + 1, endd, 2 * curr + 2, l, r);

            if (l <= mid && r > mid) {
                int t1 = query(start, mid, 2 * curr + 1, l, mid);
                int t2 = query(mid + 1, endd, 2 * curr + 2, mid + 1, r);
                return t1 & t2;
            }

            return 0;
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int pnumChars;
        private FastReader.SpaceCharFilter filter;

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

        public int read() {
            if (pnumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= pnumChars) {
                curChar = 0;
                try {
                    pnumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (pnumChars <= 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 == ',') {
                    c = read();
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}