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.util.*;
import java.math.*;

// **** C. Vasya And Array ****

public class C {
	static char [] in = new char [1000000];
	public static void main (String [] arg) throws Throwable {
		int n = nextInt();
		int m = nextInt();
		Pair [] P = new Pair [m];
		for (int i = 0; i<m; ++i) {
			int t = nextInt();
			int l = nextInt();
			int r = nextInt();
			P[i] = new Pair(l-1,r-1, t);
		}
		Arrays.sort(P);
		int [] A = new int [n];
		Arrays.fill(A, 1);
		int num = 10000;
		boolean cancan = true;
		for (int i = 0; i<m && cancan; ++i) {
			if (P[i].v == 1) continue;
			
			boolean can = false;
			for (int j = P[i].L+1; j<=P[i].R && !can; ++j) {
				if (A[j-1] > A[j]) can = true;
			}
			if (can) continue;
			
			int L = P[i].L;
			for (int j = 0; j<m; ++j) {
				if (P[j].v == 0) continue;
				if (P[j].L <= L && P[j].R >= L) { 
					L = P[j].R;
				}
			}
			if (L >= P[i].R) {
				//System.err.println("Coudln't find solution for " + P[i].L + " , " + P[i].R);
				cancan = false;
			} else {
				A[L] += num;
				num -= 2;
			}
		}
		
		for (int i = 0; i<m && cancan; ++i) {
			boolean can = false;
			for (int j = P[i].L+1; j<= P[i].R && !can; ++j) {
				if (A[j-1] > A[j]) can = true;
			}
			if (!can && P[i].v == 0) cancan = false;
			if (can && P[i].v == 1) cancan = false;
		}
		
		
		
		if (!cancan) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
			System.out.println(stringFromArray(A));
		}
	}

	/*
	
		int [] A = new int [n];
		for (int i = 0; i<n; ++i) A[i] = n-i;
		for (int i = 0; i<m; ++i) {
			if (P[i].L == 0) continue;
			Arrays.sort(A, P[i].i-1, P[i].j);
		}
		boolean cancan = true;
		for (int i = 0; i<m && cancan; ++i) {
			if (P[i].L == 1) continue;
			boolean can = false;
			for (int j = P[i].i; j< P[i].j && !can; ++j) {
				if (A[j-1] > A[j]) can = true;
			}
			if (!can) cancan = false;
		}
	
	/*
	
	
	
	
	
	
	
	
	
	
	
	
	
	/************** HELPER CLASSES ***************/
    //static class HS extends HashSet<Integer>{public HS(){super();}public HS(int a){super(a);}};
	//static class AL extends ArrayList<Integer>{public AL(){super();}public AL(int a){super (a);}};
static class Pair implements Comparable<Pair> {int L,R;long v; public Pair(int xx, int yy, long LL){L=xx;R=yy;v=LL;} public int compareTo(Pair p) {
		return (this.L < p.L) ? -1 : (this.L == p.L && this.R < p.R) ? -1 : 1;}
	}
	
	/************** FAST IO CODE FOLLOWS *****************/
	public static long nextLong() throws Throwable {
		long i = System.in.read();boolean neg = false;while (i < 33) i = System.in.read();if (i == 45) {neg=true;i=48;}i = i - 48;
		int j = System.in.read();while (j > 32) {i*=10;i+=j-48;j = System.in.read();}return (neg) ? -i : i;
	}
	public static int nextInt() throws Throwable {return (int)nextLong();}
	public static String next() throws Throwable {
		int i = 0; while (i < 33 && i != -1) i = System.in.read(); int cptr = 0; while (i >= 33) { in[cptr++] = (char)i; i = System.in.read();}
		return new String(in, 0,cptr);
	}
	/**** LIBRARIES ****/
	public static long gcdL(long a, long b) {while (b != 0) {long tmp = b;b = (a % b);a = tmp;}return a;}
	public static int gcd(int a, int b) {while (b != 0) {int tmp = b;b = (a % b);a = tmp;}return a;}
	public static int[] sieve(int LIM) {
		int i,count = 0;
		boolean [] b = new boolean [LIM];
		for (i = 2;i<LIM; ++i) if (!b[i]) {count++; for (int j = i<<1; j<LIM; j+=i) b[j] = true;}
		int [] primes = new int[count];
		for (i = 2,count=0;i<LIM;++i) if (!b[i]) primes[count++] = i;
		return primes;
	}
	public static int[] numPrimeFactors(int LIM) {
		int i,count = 0;
		int [] b = new int [LIM];
		for (i = 2;i<LIM; ++i) if (b[i] == 0) {count++; for (int j = i; j<LIM; j+=i) b[j]++;}
		return b;
	}
	public static StringBuilder stringFromArray(int [] a) {
		StringBuilder b = new StringBuilder(9*a.length);
		for (int i = 0; i<a.length; ++i) {
			if (i != 0) b = b.append(' ');
			b = b.append(a[i]);
		}
		return b;
	}
}

/* Full Problem Text:
  
Vasya has an array a_1, a_2, \dots, 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}, \dots, a_{r_i} is sorted in non-decreasing order; 
 if t_i=0 then subbarray a_{l_i}, a_{l_i + 1}, \dots, 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.

 */