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.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.StringTokenizer;
 
public class C {
	static FastReader scan;
	static PrintWriter out;
 
	public static void main(String[] args) throws FileNotFoundException {
		Solver solver = new Solver();
		scan = new FastReader();
		out = new PrintWriter(System.out);
		int testCases = 1;
		for(int i = 1; i <= testCases; i++) {
//			out.print("Case #" + i + ": ");
			solver.solve();
		}
		out.close();
	}
 
	static class Solver {
		
		void solve() {
			int n = scan.nextInt(), m = scan.nextInt();
			int[] ans = new int[n];
			Arrays.fill(ans, 1);
			ArrayList<Range> a = new ArrayList<>(), compress = new ArrayList<>(), b = new ArrayList<>();
			for(int i = 0; i < m; i++) {
				if(scan.nextInt() == 1) a.add(new Range(scan.nextInt()-1, scan.nextInt()-1));
				else b.add(new Range(scan.nextInt()-1, scan.nextInt()-1));
			}
			Collections.sort(a);
			Collections.sort(b);
			int ll = -1, rr = -1;
			for(int i = 0; i < a.size(); i++) {
				int cl = a.get(i).l, cr = a.get(i).r;
				if(cl <= rr) {
					rr = Math.max(rr, cr);
				}
				else {
					if(ll != -1) {
						compress.add(new Range(ll, rr));
					}
					ll = cl;
					rr = cr;
				}
			}
			if(ll != -1) {
				compress.add(new Range(ll, rr));
			}
			int curr = (int) (1e9);
			outer:
			for(Range j : b) {
				curr--;
				for(Range i : compress) {
					if(j.l < i.l) {
						ans[j.l] = curr;
						continue outer;
					}
					else if(j.l <= i.r) {
						if(j.r <= i.r) {
							out.println("NO");
							return;
						}
						else {
							ans[i.r] = curr;
							continue outer;
						}
					}
				}
				ans[j.l] = curr;
			}
			out.println("YES");
			for(int i : ans) out.print(i + " ");
					
			
		}
		
		static class Range implements Comparable<Range>{
			int l;
			int r;
			
			public Range(int a, int b) {
				l = a;
				r = b;
			}
 
			@Override
			public int compareTo(Range o) {
				return l-o.l;
			}
		}
		
	}
 
	// Sathvik's Template Stuff BELOW!!!!!!!!!!!!!!!!!!!!!!
 
	static class DSU {
		int[] root, size;
		int n;
 
		DSU(int n) {
			this.n = n;
			root = new int[n];
			size = new int[n];
			for (int i = 0; i < n; i++) {
				root[i] = i;
				size[i] = 1;
			}
		}
 
		int findParent(int idx) {
			while (root[idx] != idx) {
				root[idx] = root[root[idx]];
				idx = root[idx];
			}
			return idx;
		}
 
		boolean union(int x, int y) {
			int parX = findParent(x);
			int parY = findParent(y);
			if (parX == parY)
				return false;
			if (size[parX] < size[parY]) {
				root[parY] = parX;
				size[parX] += size[parY];
			} else {
				root[parX] = parY;
				size[parY] += size[parX];
			}
			return true;
		}
	}
 
	static class Extra {
		static void sort(int[] a) {
			Integer[] aa = new Integer[a.length];
			for (int i = 0; i < aa.length; i++)
				aa[i] = a[i];
			Arrays.sort(aa);
			for (int i = 0; i < aa.length; i++)
				a[i] = aa[i];
		}
 
		static void sort(long[] a) {
			Long[] aa = new Long[a.length];
			for (int i = 0; i < aa.length; i++)
				aa[i] = a[i];
			Arrays.sort(aa);
			for (int i = 0; i < aa.length; i++)
				a[i] = aa[i];
		}
 
		static void sort(double[] a) {
			Double[] aa = new Double[a.length];
			for (int i = 0; i < aa.length; i++)
				aa[i] = a[i];
			Arrays.sort(aa);
			for (int i = 0; i < aa.length; i++)
				a[i] = aa[i];
		}
 
		static void sort(char[] a) {
			Character[] aa = new Character[a.length];
			for (int i = 0; i < aa.length; i++)
				aa[i] = a[i];
			Arrays.sort(aa);
			for (int i = 0; i < aa.length; i++)
				a[i] = aa[i];
		}
 
		static long gcd(long a, long b) {
			while (b > 0) {
				long temp = b;
				b = a % b;
				a = temp;
			}
			return a;
		}
 
		static long lcm(long a, long b) {
			return a * (b / gcd(a, b));
		}
 
		static boolean isPrime(long n) {
			if (n <= 1)
				return false;
			if (n <= 3)
				return true;
			if (n % 2 == 0 || n % 3 == 0)
				return false;
			for (long i = 5; i * i <= n; i = i + 6) {
				if (n % i == 0 || n % (i + 2) == 0)
					return false;
			}
			return true;
		}
 
		static HashSet<Integer> sieve(int n) {
			boolean[] prime = new boolean[n + 1];
			HashSet<Integer> res = new HashSet<>();
			for (int p = 2; p * p <= n; p++) {
				if (!prime[p]) {
					res.add(p);
					for (int i = p * p; i <= n; i += p)
						prime[i] = true;
				}
			}
			return res;
		}
 
		static HashMap<Long, Integer> primeFactorization(long n) {
			HashMap<Long, Integer> res = new HashMap<>();
			while (n % 2 == 0) {
				res.put(2L, res.getOrDefault(2L, 0) + 1);
				n /= 2;
			}
			for (long i = 3; i * i <= n; i += 2) {
				while (n % i == 0) {
					res.put(i, res.getOrDefault(i, 0) + 1);
					n /= i;
				}
			}
			if (n > 2)
				res.put(n, 1);
			return res;
		}
	}
 
	static class FastReader {
		BufferedReader br;
		StringTokenizer st;
 
		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}
 
		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
 
		int nextInt() {
			return Integer.parseInt(next());
		}
 
		int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}
 
		long nextLong() {
			return Long.parseLong(next());
		}
 
		long[] nextLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}
 
		double nextDouble() {
			return Double.parseDouble(next());
		}
 
		double[] nextDoubleArray(int n) {
			double[] a = new double[n];
			for (int i = 0; i < n; i++)
				a[i] = nextDouble();
			return a;
		}
 
		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
 
}