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.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.InputMismatchException;
import java.util.LinkedList;

public class CEducation67 {

	public static void main(String[] args) {
		FastScanner in = new FastScanner(System.in);
		int N = in.nextInt();
		int T = in.nextInt();
		int[][] arr = new int[T][3];
		for(int i = 0; i < T; i++) {
			arr[i] = new int[] {in.nextInt(), in.nextInt() - 1, in.nextInt() - 1};
		}
		
		
		int[] ans = ans(N, T, arr);
		
		StringBuilder sb = new StringBuilder();
		if(ans == null) {
			sb.append("NO");
		}
		else {
			sb.append("YES");
			sb.append("\n");
			for(int i : ans) {
				sb.append(i);
				sb.append(" ");
			}
		}
		
		System.out.println(sb.toString().trim());
	}
	
	public static int[] ans2(int N, int T, int[][] arr) {
		ArrayList<Pair> list = new ArrayList<>();
		for(int i = 0; i < T; i++) {
			list.add(new Pair(arr[i][1], arr[i][2], arr[i][0] == 1? true : false));
		}
		
		Collections.sort(list);
		
		ArrayList<Pair> inter = new ArrayList<>();
		for(int i = 0; i < list.size(); i++) {
			if(i == 0) {
				inter.add(list.get(i));
			}
			else {
				Pair p = list.get(i);
				Pair last = inter.get(inter.size() - 1);
				if(p.bo && last.bo) {
					if(p.b == last.b) {
						last.a = Math.min(p.a, last.a);
					}
					else if(p.a > last.b) {
						inter.add(p);
					}
					else if(p.a < last.b) {
						last.b = Math.max(p.b, last.b);
					}
				}
				else if(p.bo && !last.bo) {
					
				}
			}
		}
		
		return null;
	}
	
	public static int[] ans(int N, int T, int[][] arr) {
		ArrayList<Pair> list = new ArrayList<>();
		ArrayList<Pair> list2 = new ArrayList<>();
		for(int i = 0; i < T; i++) {
			if(arr[i][0] == 1) {
				list.add(new Pair(arr[i][1], arr[i][2], true));
			}
			else {
				list2.add(new Pair(arr[i][1], arr[i][2]));
			}
		}
		
		Collections.sort(list);
		
		ArrayList<Pair> intervals = new ArrayList<>();
		for(int i = 0; i < list.size(); i++) {
			Pair p = list.get(i);
			if(intervals.size() == 0) {
				intervals.add(p);
			}
			else {
				Pair last = intervals.get(intervals.size() - 1);
				if(last.b == p.b) {
					last.a = Math.min(p.a, last.a);
				}
				else if(last.b >= p.a) {
					last.b = Math.max(p.b, last.b);
					last.a = Math.min(p.a, last.a);
				}
				else {
					intervals.add(p);
				}
			}
		}
		
		if(intervals.size() == 0) {
			int[] ans = new int[N];
			int curr = 50000;
			for(int i = 0 ; i < N; i++) {
				ans[i] = curr--;
			}
			return ans;
		}
		
		
		for(int i = 0; i < list2.size(); i++) {
			Pair p = list2.get(i);
			int[] a = binS(intervals, p.a);
			int[] b = binS(intervals, p.b);
			
			if(a[0] == 1 && b[0] == 1 && a[1] == b[1]) {
				return null;
			}
			
		}
		
		LinkedList<Pair> list3 = new LinkedList<>();
		for(Pair p : intervals) {
			list3.add(p);
		}
		
		int[] ans = new int[N];
		int curr = 50000;
		int index = 0;
		while(list3.size() != 0) {
			Pair p = list3.removeFirst();
			while(index < p.a) {
				ans[index] = curr;
				curr--;
				index++;
			}
			while(index <= p.b) {
				ans[index] = curr;
				curr++;
				index++;
			}
			curr -= 2;
		}
		
		while(index < N) {
			ans[index++] = curr;
			curr--;
		}
		
		return ans;
	}
	
	public static int[] binS(ArrayList<Pair> list, int x) {
		int low = 0;
		int high = list.size()-1;
		
		while(low <= high) {
			int mid = (low + high) / 2;
			Pair p = list.get(mid);
			
			if(p.a <= x && x <= p.b) {
				return new int[] {1, mid};
			}
			if(mid == list.size() - 1) {
				if(x > p.b) {
					return new int[] {2, mid};
				}
			}
			else {
				if(p.b < x && x < list.get(mid+1).a) {
					return new int[] {2, mid};
				}
			}
			if(mid == 0) {
				if(x < p.a) {
					return new int[] {2, mid - 1};
				}
			}
			else {
				if(list.get(mid-1).b < x && x < p.a) {
					return new int[] {2, mid - 1};
				}
			}
			if(x > p.b) {
				low = mid + 1;
			}
			else if(x < p.a) {
				high = mid - 1;
			}
		}
		
		return null;
	}
	
	static class Pair implements Comparable<Pair> {
		int a, b;
		boolean bo;
		
		public Pair(int x, int y) {
			a = x; b = y;
			bo = false;
		}
		
		public Pair(int x, int y, boolean boo) {
			a = x;
			b = y;
			bo = boo;
		}
		
		public int compareTo(Pair p2) {
			if(a != p2.a) {
				return a - p2.a;
			}
			
			return b - p2.b;
		}
		
		public String toString() {
			return bo + ": " + a + " " + b;
		}
	}
	
	/**
	 * Source: Matt Fontaine
	 */
	static class FastScanner {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int chars;

		public FastScanner(InputStream stream) {
			this.stream = stream;
		}

		int read() {
			if (chars == -1)
				throw new InputMismatchException();
			if (curChar >= chars) {
				curChar = 0;
				try {
					chars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (chars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		boolean isEndline(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

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

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

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

		public String next() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public String nextLine() {
			int c = read();
			while (isEndline(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndline(c));
			return res.toString();
		}
	}

}
/*
7 4
1 1 3
1 2 5
0 5 6
1 6 7
outputCopy
YES
1 2 2 3 5 4 4
inputCopy
4 2
1 1 4
0 2 3
outputCopy
NO

7 3
0 6 7
0 4 5
0 2 3

YES
0 -1 -2 -3 -4 -5 -6
*/