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.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
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);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {
    private static final int MAXBIT = 30;

    private int seg[], l[], r[], q[], sum[], ans[];

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int N = in.nextInt();
        int M = in.nextInt();

        l = new int[M];
        r = new int[M];
        q = new int[M];
        sum = new int[N+1];
        ans = new int[N];
        seg = new int[4 * N];

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

        for (int bit = 0; bit <= MAXBIT; bit++) {
            for (int i = 0; i < N; i++) sum[i] = 0;
            for (int i = 0; i < M; i++) {
                if (((q[i] >> bit) & 1) == 1) {
                    sum[l[i]]++;
                    sum[r[i]+1]--;
                }
            }
            for (int i = 0; i < N; i++) {
                if (i > 0) sum[i] += sum[i - 1];
                if (sum[i] > 0) {
                    ans[i] |= (1 << bit);
                }
            }
        }

        build(1, 0, N-1);

        for (int i = 0; i < M; i++) {
            if (query(1, l[i], r[i], 0, N-1) != q[i]) {
                out.println("NO");
                return;
            }
        }
        out.println("YES");
        for (int i = 0; i < N; i++) {
            out.print(ans[i] + " ");
        }
        out.println();
    }

    private void build(int idx, int l, int r) {
        if (l == r) {
            seg[idx] = ans[l];
            return;
        }

        int mid = (l + r) >> 1;
        build(2 * idx, l, mid);
        build(2 * idx + 1, mid+1, r);

        seg[idx] = seg[idx * 2] & seg[idx * 2 + 1];
    }

    private int query(int idx, int l, int r, int L, int R) {
        if (l == L && r == R) {
            return seg[idx];
        }
        int mid = (L + R) >> 1;
        int ans = (1 << MAXBIT) - 1;
        if (l <= mid) {
            ans &= query(idx * 2, l, Math.min(r, mid), L, mid);
        }
        if (mid+1 <= r) {
            ans &= query(idx * 2 + 1, Math.max(l, mid+1), r, mid+1, R);
        }
        return ans;
    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

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

