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.FileReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Agostinho Junior
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
	OutputWriter out;
	InputReader in;
	public void solve(int testNumber, InputReader in, OutputWriter out) {
		this.in = in; this.out = out;
		final int n = in.readInt();
		final int m = in.readInt();
		int[] from = new int[m];
		int[] to = new int[m];
		int[] and = new int[m];
		final int max = 30;
		int[][] sum = new int[max][n + 2];
		for (int i = 0; i < m; i++) {
			from[i] = in.readInt();
			to[i] = in.readInt();
			and[i] = in.readInt();
			for (int bit = 0; bit < max; bit++) if ((and[i] & (1<<bit)) > 0) {
				sum[bit][from[i]]++;
				sum[bit][to[i] + 1]--;
			}
		}
		int[] ans = new int[n + 1];
		for (int bit = 0; bit < max; bit++) {
			int value = 0;
			for (int i = 1; i <= n; i++) {
				value += sum[bit][i];
				int now = value > 0 ? 1 : 0;
				sum[bit][i] = now + sum[bit][i - 1];
				ans[i] |= now << bit;
			}
			for (int i = 0; i < m; i++) if ((and[i] & (1<<bit)) == 0) {
				if (sum[bit][to[i]] - sum[bit][from[i] - 1] == to[i] - from[i] + 1) {
					out.println("NO");
					return;
				}
			}
		}
		out.println("YES");
		for (int i = 1; i <= n; i++) {
			out.print(ans[i] + " ");
		}
		out.println();
	}
}

class OutputWriter {
	private PrintWriter output;
	public OutputWriter(OutputStream out) {
		output = new PrintWriter(out);
	}
	public void print(Object o) {
		output.print(o);
	}
	public void println(Object o) {
		output.println(o);
	}
	public void println() {
		output.println();
	}
	public void close() {
		output.close();
	}
}

class InputReader {
	private BufferedReader input;
	private StringTokenizer line = new StringTokenizer("");
	public InputReader(InputStream in) {
		input = new BufferedReader(new InputStreamReader(in));
	}
	public void fill() {
		try {
			if(!line.hasMoreTokens()) line = new StringTokenizer(input.readLine());
		} catch(IOException io) { io.printStackTrace(); System.exit(0);}
	}
	public int readInt() {
		fill();
		return Integer.parseInt(line.nextToken());
	}
}

