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.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Solution {
    public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer tok;

    public static class Interval implements Comparable<Interval> {
        int l;
        int r;
        int q;

        public Interval(int l, int r, int q) {
            this.l = l;
            this.r = r;
            this.q = q;
        }


        @Override
        public int compareTo(Interval o) {
            if (this.l < o.l) {
                return -1;
            } else if (this.l == o.l) {
                return Integer.compare(this.r, this.l);
            } else {
                return 1;
            }
        }
    }

    public static int nextInt() throws IOException {
        if (tok == null || !tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }

        return Integer.parseInt(tok.nextToken());
    }

    public static int getBit(int a, int k) {
        return ((a >> k) & 1);
    }

    public static int setBit(int a, int k) {
        return (a | (1 << k));
    }

    public static void main(String[] args) throws IOException {
        int n = nextInt();
        int m = nextInt();

        Interval[] intervals = new Interval[m];
        for (int i = 0; i < m; i++) {
            intervals[i] = new Interval(nextInt() - 1, nextInt() - 1, nextInt());
        }

        Arrays.sort(intervals);

        int[] result = new int[n];

        for (int j = 0; j < 30; j++) {
            int lastR = -1;
            for (int i = 0; i < m; i++) {
                if (getBit(intervals[i].q, j) == 1 && intervals[i].r > lastR) {
                    for (int k = Math.max(lastR, intervals[i].l); k <= intervals[i].r; k++) {
                        result[k] = setBit(result[k], j);
                    }

                    lastR = intervals[i].r;
                }
            }
        }

        boolean possible = true;
        for (int j = 0; j < 30 && possible; j++) {
            int lastL = -1;
            int[] zerosCount = new int[n + 1];
            zerosCount[0] = 0;
            for (int i = 0; i < n; i++) {
                zerosCount[i + 1] = zerosCount[i] + (getBit(result[i], j) == 0 ? 1 : 0);
            }

            for (int i = 0; i < m && possible; i++) {
                if (getBit(intervals[i].q, j) == 0) {
                    possible = (zerosCount[intervals[i].r + 1] - zerosCount[intervals[i].l] > 0);
                }
            }
        }

        if (!possible) {
            System.out.println("NO");
        } else {
            System.out.println("YES");
            for (int i = 0; i < n; i++) {
                System.out.print(result[i] + " ");
            }
        }
    }
}
