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.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main {

	public static void main(String[] args) throws IOException {
		new Main().run();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");

	private void run() throws IOException {
		if (new File("input.txt").exists())
			in = new BufferedReader(new FileReader("input.txt"));
		else
			in = new BufferedReader(new InputStreamReader(System.in));
		if (new File("output.txt").exists())
			out = new PrintWriter("output.txt");
		else
			out = new PrintWriter(System.out);

		solve();

		in.close();
		out.close();
	}

	final int maxn = 100 * 1000 + 10;
	final int maxLog = 31;

	int n, m;

	int d[][] = new int[maxLog][maxn];
	int s[][] = new int[maxLog][maxn];

	int mask[] = new int[maxn];

	int l[] = new int[maxn];
	int r[] = new int[maxn];
	int q[] = new int[maxn];

	PriorityQueue<Event> events = new PriorityQueue<>();

	void print() {
		for (int i = 0; i < n; i++) {
			int a = 0;
			for (int j = 0; j < maxLog; j++) {
				a |= (d[j][i] << j);
			}
			out.print(a + " ");
		}
		out.println();
	}

	void solve() throws IOException {
		n = nextInt();
		m = nextInt();
		for (int i = 0; i < m; i++) {
			l[i] = nextInt() - 1;
			r[i] = nextInt() - 1;
			q[i] = nextInt();
			events.add(new Event(l[i], q[i], true));
			events.add(new Event(r[i] + 1, q[i], false));
		}

		fill(mask, 0);
		for (int i = 0; i < n; i++) {
			while (!events.isEmpty() && events.element().index == i) {
				final Event event = events.remove();
				final int sg = event.isOpen ? 1 : -1;
				final int q = event.q;
				for (int j = 0; j < maxLog; j++)
					mask[j] += sg * ((q >> j) & 1);
			}
			for (int j = 0; j < maxLog; j++)
				d[j][i] = mask[j] > 0 ? 1 : 0;
		}

		for (int j = 0; j < maxLog; j++)
			s[j][0] = d[j][0];
		for (int i = 1; i < n; i++)
			for (int j = 0; j < maxLog; j++)
				s[j][i] = s[j][i - 1] + d[j][i];

		boolean isAns = true;
		for (int i = 0; i < m && isAns; i++) {
			for (int j = 0; j < maxLog && isAns; j++) {
				final int count = s[j][r[i]] - (l[i] > 0 ? s[j][l[i] - 1] : 0);
				if (((q[i] >> j) & 1) > 0)
					isAns = (count == r[i] - l[i] + 1);
				else
					isAns = (count < r[i] - l[i] + 1);
			}
		}

		out.println(isAns ? "YES" : "NO");
		if (isAns) {
			print();
		}
	}

	class Event implements Comparable<Event> {
		int index;
		int q;
		boolean isOpen;

		public Event(int index, int q, boolean isOpen) {
			super();
			this.index = index;
			this.q = q;
			this.isOpen = isOpen;
		}

		@Override
		public int compareTo(Event o) {
			return Integer.compare(index, o.index);
		}

	}

	String nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}

	String nextToken() throws IOException {
		while (!st.hasMoreTokens()) {
			st = new StringTokenizer(in.readLine());
		}
		return st.nextToken();
	}

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

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

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

	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String str = in.readLine();
			if (str == null)
				return true;
			st = new StringTokenizer(str);
		}
		return false;
	}

}
