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.awt.image.ReplicateScaleFilter;
import java.io.*;
import java.math.*;
import java.util.*;

import javax.swing.RepaintManager;

public class Main {

	static long mod = (long) 1e9 + 7;

	public static void main(String[] args) {
		FasterScanner s = new FasterScanner();
		PrintWriter out = new PrintWriter(System.out);

		int test = 1;

		testloop: while (test-- > 0) {
			int n = s.nextInt();
			int m = s.nextInt();
			int[][] x = new int[30][n + 1];
			int[] qL = new int[m];
			int[] qR = new int[m];
			int[] qY = new int[m];
			int j = 0;
			while (m-- > 0) {
				int l = qL[j] = s.nextInt() - 1;
				int r = qR[j] = s.nextInt() - 1;
				int y = qY[j++] = s.nextInt();
				for (int i = 0; i < 30; i++) {
					if ((y & (1 << i)) != 0) {
						x[i][l]++;
						x[i][r + 1]--;
					}
				}
			}
			int[] ans = new int[n];
			for (int i = 0; i < 30; i++) {
				for (j = 0; j < n; j++) {
					if (j > 0)
						x[i][j] += x[i][j - 1];
					if (x[i][j] > 0) {
						ans[j] |= (1 << i);
					}
				}
			}
			int[] segTree = new int[2 * n];
			for (int i = 0; i < n; i++)
				add(segTree, i, ans[i]);

			for (int i = 0; i < qL.length; i++) {
				if (max(segTree, qL[i], qR[i]) != qY[i]) {
					out.println("NO");
					continue testloop;
				}
			}
			out.println("YES");
			printArray(ans, out);
		}
		out.close();
	}

	public static void add(int[] t, int i, int value) {
		i += t.length / 2;
		t[i] += value;
		for (; i > 1; i >>= 1)
			t[i >> 1] = t[i] & t[i ^ 1];
	}

	// max[a, b]
	public static int max(int[] t, int a, int b) {
		int res = (1<<30) - 1;
		for (a += t.length / 2, b += t.length / 2; a <= b; a = (a + 1) >> 1, b = (b - 1) >> 1) {
			if ((a & 1) != 0)
				res = res & t[a];
			if ((b & 1) == 0)
				res = res & t[b];
		}
		return res;
	}

	public static class Node implements Comparable<Node> {
		int id, val;

		Node(int id1, int val1) {
			id = id1;
			val = val1;
		}

		public int compareTo(Node o) {
			if (this.val != o.val)
				return Integer.compare(this.val, o.val);
			return this.id - o.id;
		}

	}

	public static void printArray(int[] a, PrintWriter out) {
		for (int i = 0; i < a.length; i++) {
			out.print(a[i]);
			out.print(' ');
		}
		out.println();
	}

	public static long pow(long x, long n, long mod) {
		long res = 1;
		for (long p = x; n > 0; n >>= 1, p = (p * p) % mod) {
			if ((n & 1) != 0) {
				res = (res * p % mod);
			}
		}
		return res;
	}

	static long gcd(long n1, long n2) {
		long r;
		while (n2 != 0) {
			r = n1 % n2;
			n1 = n2;
			n2 = r;
		}
		return n1;
	}

	static class FasterScanner {
		private byte[] buf = new byte[1024];
		private int curChar;
		private int snumChars;

		public int read() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = System.in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public String nextString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long 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 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 int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray(int n) {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}

		private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
	}
}