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;

public class InterestingArray {

	public static int tree[];
	public static int lazy[];

	public static void create(int s, int e, int p, int l, int r, int val) {
		if (lazy[p] != 0) {
			tree[p] |= lazy[p];

			if (s != e) {
				lazy[p * 2] |= lazy[p];
				lazy[p * 2 + 1] |= lazy[p];
			}
			lazy[p] = 0;
		}

		if (s > r || e < l)
			return;

		if (s >= l && e <= r) {

			tree[p] |= val;
			if (s != e) {
				lazy[p * 2] |= val;
				lazy[p * 2 + 1] |= val;
			}

			return;

		}

		int mid = (s + e) / 2;

		create(s, mid, p * 2, l, r, val);
		create(mid + 1, e, p * 2 + 1, l, r, val);

		tree[p] = tree[p * 2] & tree[p * 2 + 1];
	}

	public static long get(int s, int e, int p, int l, int r) {
		if (lazy[p] != 0) {
			tree[p] |= lazy[p];
			if (s != e) {
				lazy[p * 2] |= lazy[p];
				lazy[p * 2 + 1] |= lazy[p];
			}
			lazy[p] = 0;
		}

		if (s > r || e < l)
			return (1L << 31)-1;

		if (s >= l && e <= r) {
			//System.out.println(s + " " + e + " " + tree[p]);
			return tree[p];
		}

		int mid = (s + e) / 2;
		long a = get(s, mid, p * 2, l, r);
		long b = get(mid + 1, e, p * 2 + 1, l, r);
		return (a & b);

	}

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder qq = new StringBuilder();
	
		String y[] = in.readLine().split(" ");
		int n = Integer.parseInt(y[0]);
		int m = Integer.parseInt(y[1]);
		tree = new int[n * 4];
		lazy = new int[n * 4];
		int q[][] = new int[m][3];
		for (int i = 0; i < m; i++) {
			y = in.readLine().split(" ");
			int l = Integer.parseInt(y[0]);
			int r = Integer.parseInt(y[1]);
			int val = Integer.parseInt(y[2]);
			q[i][0] = l;
			q[i][1] = r;
			q[i][2] = val;
			create(1, n, 1, l, r, val);

			//System.out.println(Arrays.toString(tree));
			//System.out.println(Arrays.toString(lazy));
		}

		for (int i = 0; i < m; i++) {
			if (get(1, n, 1, q[i][0], q[i][1]) != q[i][2]) {

			//	System.out.println(get(1, n, 1, q[i][0], q[i][1]));
				System.out.println("NO");
				return;
			}
		}
		qq.append("YES\n");
		for (int i = 1; i <= n; i++) {
			qq.append(get(1, n, 1, i, i)+" ");
		}
		qq.append("\n");
		System.out.print(qq);

	}

}
