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.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.StringTokenizer;

import javax.swing.plaf.synth.SynthSpinnerUI;

public class cf2 {
	static final double EPS = 1e-9;

	static int[] isComposite;
	static ArrayList<Integer> primes;
	static int n;
	static int k;
	static long x[];

	public static void main(String[] args) throws IOException {

		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		int m = sc.nextInt();

		int destroyer = 5000;
		// ArrayList<Point> nonsort= new ArrayList<>();
		Point[] nonsort = new Point[m];

		int ans[] = new int[n];
		ans[0] = 1;
		for (int i = 1; i < n; i++) {
			ans[i] = ans[i - 1] + 1;
		}

		int [] sortit = new int [n];
		int [] unsortit = new int [n];
		
		ArrayList<Point> sortP = new ArrayList<>();
		ArrayList<Point> unsortP = new ArrayList<>();
		
		for (int i = 0; i < m; i++) {
			int t = sc.nextInt();
			int beg = sc.nextInt();
			int last = sc.nextInt();

			if(t==1) {
				sortP.add(new Point(beg, last));
			}else {
				unsortP.add(new Point(beg, last));
			}
			
		}
		Collections.sort(sortP);
		Collections.sort(unsortP);
		
		int curLevel=5000;
		Arrays.fill(sortit, 1);
		for(int i=0;i<sortP.size();i++) {
			Point curPoint = sortP.get(i);
//			System.out.println((curPoint.x-1)+" "+curPoint.y);
		    if(sortit[curPoint.x-1]==1&&i!=0) {
		    	curLevel-=5;
		    	Arrays.fill(sortit, curPoint.x - 1, curPoint.y, curLevel);
		    }else {
		    	Arrays.fill(sortit, curPoint.x - 1, curPoint.y, curLevel);
		    }	
//		    System.out.println(Arrays.toString(sortit));
		}
//		System.out.println(Arrays.toString(sortit));
	    int kick = 10000000;
		for(int i=0;i<unsortP.size();i++) {
			Point curPoint = unsortP.get(i);
            int f=0;
//            System.out.println((curPoint.x - 1));
//            System.out.println(curPoint.y);
//        	System.out.println(Arrays.toString(sortit));
//            System.out.println("-----------");
			for(int j=curPoint.x - 1;j<curPoint.y;j++) {
            	if(j<curPoint.y-1&&sortit[j]>sortit[j+1]) {
            		f=1;
            		break;
            	}else if(j!=curPoint.y-1&&sortit[j]==1&&sortit[j+1]>=1) {
            		if(j==0||(j>=1&&sortit[j-1]==1))
            		sortit[j]=sortit[j+1]+kick;
            		else
            			sortit[j]=sortit[j-1]-1;
            		kick-=5005;
            		f=1;
            		break;
            	}
            }
			if(f==0) {
				System.out.println("NO");
				return;
			}
			
		}

		StringBuilder sb = new StringBuilder();
		for(int i=0;i<sortit.length;i++) {
			sb.append(sortit[i]+" ");
		}
		System.out.println("YES");
		System.out.println(sb.toString());
		
		
//		if (t == 0) {
//			Arrays.fill(unsortit, beg - 1, last, -1);
//		} else {
//			Arrays.fill(sortit, beg - 1, last, 1);
//			
//		}
	
	}

	public static class Point implements Comparable<Point> {

		static final double EPS = 1e-9;

		int x, y;
		// String c;

		Point(int a, int b) {
			x = a;
			y = b;
			// c = s;
		}

		public int compareTo(Point p) {
			if (Math.abs(x - p.x) > EPS)
				return x > p.x ? 1 : -1;
			if (Math.abs(y - p.y) > EPS)
				return y > p.y ? 1 : -1;
			return 0;
		}

	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public Scanner(String file) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(file));
		}

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

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

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public long nextlong() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			long res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}
}