Problem: Vasya has an array a_1, a_2, ..., a_n.

You don't know this array, but he told you m facts about this array. The i-th fact is a triple of numbers t_i, l_i and r_i (0 ≤ t_i ≤ 1, 1 ≤ l_i < r_i ≤ n) and it means:

  * if t_i=1 then subbarray a_{l_i}, a_{l_i + 1}, ..., a_{r_i} is sorted in non-decreasing order; 
  * if t_i=0 then subbarray a_{l_i}, a_{l_i + 1}, ..., a_{r_i} is not sorted in non-decreasing order. A subarray is not sorted if there is at least one pair of consecutive elements in this subarray such that the former is greater than the latter. 



For example if a = [2, 1, 1, 3, 2] then he could give you three facts: t_1=1, l_1=2, r_1=4 (the subarray [a_2, a_3, a_4] = [1, 1, 3] is sorted), t_2=0, l_2=4, r_2=5 (the subarray [a_4, a_5] = [3, 2] is not sorted), and t_3=0, l_3=3, r_3=5 (the subarray [a_3, a_5] = [1, 3, 2] is not sorted).

You don't know the array a. Find any array which satisfies all the given facts.

Input

The first line contains two integers n and m (2 ≤ n ≤ 1000, 1 ≤ m ≤ 1000).

Each of the next m lines contains three integers t_i, l_i and r_i (0 ≤ t_i ≤ 1, 1 ≤ l_i < r_i ≤ n).

If t_i = 1 then subbarray a_{l_i}, a_{l_i + 1}, ... , a_{r_i} is sorted. Otherwise (if t_i = 0) subbarray a_{l_i}, a_{l_i + 1}, ... , a_{r_i} is not sorted.

Output

If there is no array that satisfies these facts in only line print NO (in any letter case).

If there is a solution, print YES (in any letter case). In second line print n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^9) — the array a, satisfying all the given facts. If there are multiple satisfying arrays you can print any of them.

Examples

Input


7 4
1 1 3
1 2 5
0 5 6
1 6 7


Output


YES
1 2 2 3 5 4 4


Input


4 2
1 1 4
0 2 3


Output


NO

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;
 
public class Solution {
 
	static final int mod = (int) 1e9 + 7;
	static final int proMod = (int) 1e9 + 6;
	static long fac[], ifac[], DR[] = new long[101];
	static int MOD = (int) (1e9 + 7);
	static boolean[] isPrime;
	static int minPrime[];
	static long dp[][];
	static int n;
	static int d, x, y;
 
	public static void main(String args[]) {
		InputReader in = new InputReader(System.in);
		PrintWriter w = new PrintWriter(System.out);
 
		int n = in.nextInt();
		int m = in.nextInt();
		Pair p[] = new Pair[m];
		for (int i = 0; i < m; i++) {
			p[i] = new Pair(in.nextInt(), in.nextInt(), in.nextInt());
		}
		int ans = 0;
		int a[] = new int[n + 2];
 
		for (int i = 0; i < m; i++) {
			if (p[i].type == 1) {
				for (int j = p[i].x + 1; j <= p[i].y; j++) {
					a[j] = 1;
				}
			}
		}
		for (int i = 0; i < m; i++) {
			if (p[i].type == 0) {
				int pos = 0;
				for (int j = p[i].x + 1; j <= p[i].y; j++) {
					if (a[j] != 1) {
						pos = 1;
					}
				}
				if (pos == 0)
					ans = -1;
 
			}
		}
		if (ans == -1) {
			w.println("NO");
 
		} else {
			Stack<Integer> stack = new Stack<Integer>();
			int res[] = new int[n + 2];
			int j = 0;
			for (int i = 2; i <= n; i++) {
				if (a[i] == 1) {
					stack.push(i - 1);
					while (!stack.isEmpty())
						res[j++] = stack.pop();
				} else
					stack.push(i - 1);
			}
			stack.push(n);
			while (!stack.isEmpty())
				res[j++] = stack.pop();
			w.println("YES");
			for (int i = 0; i < n; i++) {
				w.print(res[i] + " ");
			}
		}
		w.close();
 
	}
 
	static long fastPow(int a, int b) {
		if (b == 0)
			return 1;
		long t = fastPow(a, b >> 1);
		t = (t * t) % mod;
		if ((b & 1) != 0)
			t = (t * a) % mod;
		return t;
	}
 
	static void Dr() {
		DR[0] = 1;
		DR[1] = 0;
		DR[2] = 1;
		for (int i = 3; i < 101; i++) {
			DR[i] = ((i - 1) * (DR[i - 1] + DR[i - 2]) % MOD) % MOD;
		}
 
	}
 
	static long mp(long a, long b) {
		long ans = 1;
 
		while (b != 0) {
			if (b % 2 == 1)
				ans = (ans * a) % MOD;
 
			a = (a * a) % MOD;
			b /= 2;
 
		}
		return ans % MOD;
	}
 
	static void precompute() {
		int i;
		int N = 1000005;
		fac = new long[N];
		ifac = new long[N];
		fac[0] = 1;
		for (i = 1; i < N; i++) {
			fac[i] = (i * fac[i - 1]) % MOD;
		}
		ifac[N - 1] = mp(fac[N - 1], MOD - 2);
		for (i = N - 2; i >= 0; i--) {
			ifac[i] = ((i + 1) * ifac[i + 1]) % MOD;
 
		}
	}
 
	public static long combine(int n, int k) {
		if (k > n - k) {
			k = n - k;
		}
		long result = 1;
		for (int i = 0; i < k; i++) {
			result *= (n - i);
			result /= (i + 1);
		}
		return result;
	}
 
	static long mInv(long A) {
 
		return mp(A, MOD - 2);
 
	}
 
	static long mC(int n, int k) {
		// calculates C(n,k) mod p (assuming p is prime).
		// if(k>n-k)k=n-k;
		long an; // n * (n-1) * ... * (n-k+1)
		if (k <= 0)
			return 1;
		if (n < k)
			return 0;
 
		an = fac[n] % MOD;
		an *= ifac[n - k];
		an %= MOD;
		an *= ifac[k];
		an %= MOD;
 
		// numerator / denominator mod p.
		return an;
	}
 
	static int gcd(int num1, int num2) {
		if (num1 > num2) {
			int temp = num1;
			num1 = num2;
			num2 = temp;
		}
		while (num1 != 0) {
			int temp = num1;
			num1 = num2 % num1;
			num2 = temp;
		}
		return num2;
	}
 
	static long gcd(long A, long B) {
		if (B == 0)
			return A;
		else
			return gcd(B, A % B);
	}
 
	static void extendedEuclid(int A, int B) {
		if (B == 0) {
			d = A;
			x = 1;
			y = 0;
		} else {
			extendedEuclid(B, A % B);
			int temp = x;
			x = y;
			y = temp - (A / B) * y;
		}
	}
 
	// if(gcd(A,M)==1)
	static int mInv2(int A, int M) {
		extendedEuclid(A, M);
		return (x % M + M) % M;
	}
 
	static void sieve() {
 
		int N = 100005;
 
		isPrime = new boolean[N + 1];
		minPrime = new int[N + 1];
 
		for (int i = 0; i <= N; ++i) {
			isPrime[i] = true;
			minPrime[i] = i;
		}
		isPrime[0] = false;
		isPrime[1] = false;
		for (int i = 2; i * i <= N; ++i) {
			if (isPrime[i] == true) {
				for (int j = i * i; j <= N; j += i) {
					isPrime[j] = false;
					minPrime[j] = i;
				}
			}
		}
 
	}
 
	static class Pair implements Comparable<Pair> {
		int x;
		int y;
		int type;
 
		Pair(int t, int xx, int yy) {
			x = xx;
			y = yy;
			type = t;
		}
 
		public int compareTo(Pair o) {
			if (Long.compare(this.x, o.x) != 0)
				return Long.compare(this.x, o.x);
			else
				return Long.compare(this.y, o.y);
		}
	}
 
	static class InputReader {
 
		private InputStream stream;
		private byte[] buf = new byte[8192];
		private int curChar;
		private int snumChars;
		private SpaceCharFilter filter;
 
		public InputReader(InputStream stream) {
			this.stream = stream;
		}
 
		public int snext() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
 
		public int nextInt() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
 
			int res = 0;
 
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
 
			return res * sgn;
		}
 
		public long nextLong() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
 
			long res = 0;
 
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
 
			return res * sgn;
		}
 
		public String readString() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}
 
		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
 
		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
 
}