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.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
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;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BInterestingArray solver = new BInterestingArray();
        solver.solve(1, in, out);
        out.close();
    }

    static class BInterestingArray {
        public void solve(int testNumber, FastReader s, PrintWriter out) {
            int n = s.nextInt();
            int m = s.nextInt();
            int[][] sum = new int[30][n + 1];
            BInterestingArray.query[] q = new BInterestingArray.query[m];
            for (int i = 0; i < m; i++) {
                q[i] = new BInterestingArray.query(s.nextInt() - 1, s.nextInt() - 1, s.nextInt());
            }

            for (int i = 0; i <= 30; i++) {
                for (int j = 0; j < m; j++) {
                    if (((1 << i) & q[j].andVal) != 0) {
                        int from = q[j].from;
                        int to = q[j].to;

                        sum[i][from]++;
                        sum[i][to + 1]--;
                    }
                }
            }

            int[][] arr1 = new int[30][n];

            for (int i = 0; i < 30; i++) {
                arr1[i][0] = sum[i][0];
            }

            for (int i = 0; i < 30; i++) {
                for (int j = 1; j < n; j++) {
                    arr1[i][j] = arr1[i][j - 1] + sum[i][j];
                }
            }

            int[] ans = new int[n];
            for (int i = 0; i < 30; i++) {
                for (int j = 0; j < n; j++) {
                    if (arr1[i][j] > 0) {
                        ans[j] += (1 << i);
                    }
                }
            }
//        out.println(arrays.printArr(ans));
            boolean ok = true;
            if (n == 1) {
                for (int i = 0; i < m; i++) {
                    if (q[i].andVal != q[0].andVal) {
                        ok = false;
                    }
                }
                if (!ok) {
                    out.println("NO");
                } else {
                    out.println("YES");
                    out.println(q[0].andVal);

                }
                return;
            }


            BInterestingArray.SegTree st = new BInterestingArray.SegTree(ans);

            for (int i = 0; i < m; i++) {
                int a = st.Query(q[i].from, q[i].to);
                if (a != q[i].andVal) {
                    ok = false;
                    break;
                }
            }

            if (!ok) {
                out.println("NO");
            } else {
                out.println("YES");
                out.println(BInterestingArray.arrays.printArr(ans));
            }

//        out.println(arrays.printArr(arr));
        }

        private static class query {
            int from;
            int to;
            int andVal;

            public query(int from, int to, int andVal) {
                this.from = from;
                this.to = to;
                this.andVal = andVal;
            }

        }

        private static class arrays {
            static String formatString(String str) {
                str = str.replace(",", "").replace("[", "").replace("]", "");
                return str;
            }

            static StringBuilder printArr(Object arr) {
                String str = null;
                if (arr instanceof int[]) {
                    str = Arrays.toString((int[]) arr);
                }

                if (arr instanceof long[]) {
                    str = Arrays.toString((long[]) arr);
                }

                if (arr instanceof char[]) {
                    str = Arrays.toString((char[]) arr);
                }

                if (arr instanceof boolean[]) {
                    str = Arrays.toString((boolean[]) arr);
                }

                if (arr instanceof byte[]) {
                    str = Arrays.toString((byte[]) arr);
                }

                if (arr instanceof double[]) {
                    str = Arrays.toString((double[]) arr);
                }

                if (arr instanceof float[]) {
                    str = Arrays.toString((float[]) arr);
                }

                if (arr instanceof short[]) {
                    str = Arrays.toString((short[]) arr);
                }

                if (str != null) {
                    return new StringBuilder(formatString(str));
                }

                return null;

            }

        }

        private static class SegTree {
            int[] st;
            int[] arr;

            public SegTree(int[] arr) {
                this.arr = arr;
                int size = (int) Math.ceil(Math.log(arr.length) / Math.log(2));
                st = new int[(int) ((2 * Math.pow(2, size)) - 1)];
                buildSegmentTree(1, 0, arr.length - 1);
            }

            private void buildSegmentTree(int index, int L, int R) {
                if (L == R) {
                    st[index] = arr[L];
                    return;
                }

                buildSegmentTree(index * 2, L, (L + R) / 2);
                buildSegmentTree(index * 2 + 1, (L + R) / 2 + 1, R);
                //          Replace this line if you want to change the function of the Segment tree.
                st[index] = st[index * 2] & st[index * 2 + 1];
            }

            private int Query(int queL, int queR) {
                return Query1(1, 0, arr.length - 1, queL, queR);
            }

            private int Query1(int index, int segL, int segR, int queL, int queR) {
                if (queL > segR || queR < segL) {
                    return -1;
                }

                if (queL <= segL && queR >= segR) {
                    return st[index];
                }

                int ans1 = Query1(index * 2, segL, (segL + segR) / 2, queL, queR);
                int ans2 = Query1(index * 2 + 1, (segL + segR) / 2 + 1, segR, queL, queR);
                if (ans1 == -1) {
                    return ans2;
                }

                if (ans2 == -1) {
                    return ans1;
                }
                //             Segment tree implemented for range minimum query. Change the below line to change the function.
                return ans1 & ans2;
            }

        }

    }

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

        public FastReader(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;
        }

        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);

        }

    }
}

