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.util.*;
import java.io.*;

public class D_483 {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		
		int n = sc.nextInt(), m = sc.nextInt();
		int N = 1;
		while(N < n)
			N <<= 1;
		int[] array = new int[N + 1];
		SegmentTree tree = new SegmentTree(array);
		
		int[][] cond = new int[m][3];
		for(int i = 0; i < m; i++)
			cond[i] = sc.nextIntArray(3);
		
		for(int i = 0; i < m; i++)
			tree.update_range(cond[i][0], cond[i][1], cond[i][2]);
		
		boolean flag = true;
		for(int i = 0; i < m; i++)
			if(tree.query(cond[i][0], cond[i][1]) != cond[i][2])
				flag = false;
		
		if(flag) {
			pw.println("YES");
			for(int i = 0; i < n; i++)
				pw.print(tree.query(i + 1, i + 1) + (i == n - 1 ? "\n" : " "));
		} else {
			pw.println("NO");
		}
		pw.flush();
	}
	
	public static class SegmentTree {
		
		int N;
		int[] in, sTree, lazy;
		
		public SegmentTree(int[] array) {
			in = array;
			N = array.length - 1;
			sTree = new int[N<<1];
			lazy = new int[N<<1];
			build(1, 1, N);
		}
		
		public void build(int node, int b, int e) {
			if(b == e) {
				sTree[node] = in[b];
				return;
			}
			
			int left = node<<1, right = node<<1|1;
			int mid = (b + e)>>1;
			
			build(left, b, mid);
			build(right, mid + 1, e);
			
			sTree[node] = sTree[left] & sTree[right];
		}
		
		public int query(int l, int r) {
			return query(1, 1, N, l, r);
		}
		
		public int query(int node, int b, int e, int l, int r) {
			if(r < b || l > e)
				return -1;
			if(b >= l && e <= r)
				return sTree[node];
			
			int left = node<<1, right = node<<1|1;
			int mid = (b + e)>>1;
			
			propagate(node, b, e, left, right, mid);
			
			int x = query(left, b, mid, l, r), y = query(right, mid + 1, e, l, r);
			if(x == -1)
				return y;
			if(y == -1)
				return x;
			return x & y;
		}
		
		public void update_range(int l, int r, int v) {
			update_range(1, 1, N, l, r, v);
		}
		
		public void update_range(int node, int b, int e, int l, int r, int v) {
			if(l > e || r < b)
				return;
			if(b >= l && e <= r) {
				sTree[node] |= v;
				lazy[node] |= v;
				return;
			}
			
			int left = node<<1, right = node<<1|1;
			int mid = (b + e)>>1;
			
			propagate(node, b, e, left, right, mid);
			
			update_range(left, b, mid, l, r, v);
			update_range(right, mid + 1, e, l, r, v);
			
			sTree[node] = sTree[left] & sTree[right];
		}
		
		public void propagate(int node, int b, int e, int left, int right, int mid) {
			lazy[left] |= lazy[node];
			lazy[right] |= lazy[node];
			sTree[left] |= lazy[node];
			sTree[right] |= lazy[node];
			lazy[node] = 0;
		}
		
	}

	public static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

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

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] array = new int[n];
			for (int i = 0; i < n; i++)
				array[i] = nextInt();
			return array;
		}

		public Integer[] nextIntegerArray(int n) throws IOException {
			Integer[] array = new Integer[n];
			for (int i = 0; i < n; i++)
				array[i] = new Integer(nextInt());
			return array;
		}

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

		public double[] nextDoubleArray(int n) throws IOException {
			double[] array = new double[n];
			for (int i = 0; i < n; i++)
				array[i] = nextDouble();
			return array;
		}

		public static int[] shuffle(int[] a) {
			int n = a.length;
			Random rand = new Random();
			for (int i = 0; i < n; i++) {
				int tmpIdx = rand.nextInt(n);
				int tmp = a[i];
				a[i] = a[tmpIdx];
				a[tmpIdx] = tmp;
			}
			return a;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}
