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 tr0 {
	static PrintWriter out;
	static StringBuilder sb;
	static final double EPS = 1e-9;
	static int mod = 1000000007;
	static int inf = (int)1e9+2;
	static long[] fac;
	static int[] si;
	static ArrayList<Integer> primes;
	static ArrayList<Integer>[]ad;
	static int []ans;
	static int n,m,k;
	static HashMap<Integer,Integer> t;
	static boolean f;
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
	    int n=sc.nextInt();
	    PriorityQueue <seg> one=new PriorityQueue();
	    PriorityQueue <seg> zero=new PriorityQueue();
	    int []ans=new int[n];
	    int m=sc.nextInt();
	    for(int i=0;i<m;i++) {
	    	if(sc.nextInt()==0) {
	    		int l=sc.nextInt()-1;
	    		int r=sc.nextInt()-1;
	    		zero.add(new seg(l,r));
	    	}
	    	else {
	    		int l=sc.nextInt()-1;
	    		int r=sc.nextInt()-1;	
	    		one.add(new seg(l,r));
	    	}
	    }
	    for(seg s:zero) {
	    	for(seg s1:one) {
		    	if(s.s>= s1.s && s.e<=s1.e) {
		    		System.out.println("NO");
		    		return;
		    	}
		    }
	    }
	    PriorityQueue <seg> none=new PriorityQueue();
	    while(!one.isEmpty()) {
	    	seg cur=one.poll();
	    	while(!one.isEmpty()) {
	    		if(one.peek().s<=cur.e) {
	    			cur=new seg(cur.s, Math.max(one.peek().e,cur.e));
	    			one.remove();
	    		}
	    		else {
	    			break;
	    		}
	    	}
	    	none.add(cur);
	    }
	    
	    for(seg s:zero) {
	    	for(seg s1:none) {
		    	if(s.s>= s1.s && s.e<=s1.e) {
		    		System.out.println("NO");
		    		return;
		    	}
		    }
	    }
	    int val=1000000000;
	    out.println("YES");
	    for(int i=0;i<n;i++) {
	    	if(none.isEmpty()) {
	    		ans[i]=val--;
	    	}
	    	else if(none.peek().s==i) {
	    		seg cur=none.poll();
	    		while(i<=cur.e) {
	    			ans[i]=val;
	    			i++;
	    		}
	    		val--;
	    		i--;
	    	}
	    	else {
	    		ans[i]=val--;
	    	}
	    }
	    for(int i=0;i<n;i++)
	    	out.print(ans[i]+" ");
		out.flush();
	}
	static class seg implements Comparable<seg>{
		int s;
		int e;
		seg(int s,int e){
			this.s=s;
			this.e=e;
		}
		public String toString() {
			return s+" "+e;
		}
		@Override
		public int compareTo(seg o) {
			if(s==o.s)
				return e-o.e;
			return s-o.s;
		}
	}
	static void dfs(int u) {
		int counter=1;
		for(int v:ad[u])
			if(ans[v]==0) {
				if(counter==ans[u]) {
				   counter++;
					ans[v]=counter;
				}
				else
				ans[v]=counter++;
				if(counter>k)
					f=false;
				dfs(v);
			}
	}
	static void bfs(int s) {
		Queue <Integer> q=new LinkedList();
		q.add(s);
		ans[s]=1;
		while(!q.isEmpty()) {
			int u=q.remove();
			int c=1;
			for(int v:ad[u]) {
				if(ans[v]==0) {
					//System.out.println(u);
				if(c==ans[u]) {
					   c++;
						ans[v]=c++;
					}
				else
					ans[v]=c++;
				//System.out.println(v+" "+c);
				if(ans[v]>k)
					f=false;
				q.add(v);
				}
			}
		}
	}
	static void seive() {
		 si=new int [1000001];
		    primes=new ArrayList<>();
		    int N=1000001;
		    si[1]=1;
		    for(int i=2;i<N;i++) {
		    	if(si[i]==0) {
		    		si[i]=i;
		    		primes.add(i);
		    	}
		    	for(int j=0;j<primes.size() && primes.get(j)<=si[i] && (i*primes.get(j))<N;j++)
		    		si[primes.get(j)*i]=primes.get(j);
		    		
		    }
	}
	static long inver(long x) {
		int a = (int) x;
		long e = (mod - 2);
		long res = 1;
		while (e > 0) {
			if ((e & 1) == 1) {
				// System.out.println(res*a);
				res = (int) ((1l * res * a) % mod);
			}
			a = (int) ((1l * a * a) % mod);
			e >>= 1;
		}
		// out.println(res+" "+x);
		return res % mod;
	}

	static long fac(int n) {
		if (n == 0)
			return fac[n] = 1;
		if (n == 1)
			return fac[n] = 1;
		long ans = 1;
		for (int i = 1; i <= n; i++)
			fac[i] = ans = (i % mod * ans % mod) % mod;
		return ans % mod;
	}

	static int gcd(int a, int b) {

		if (b == 0)
			return a;
		return gcd(b, a % b);
	}

	static class unionfind {
		int[] p;
		int[] size;

		unionfind(int n) {
			p = new int[n];
			size = new int[n];

			for (int i = 0; i < n; i++) {
				p[i] = i;
			}
			Arrays.fill(size, 1);
		}

		int findSet(int v) {
			if (v == p[v])
				return v;
			return p[v] = findSet(p[v]);
		}

		boolean sameSet(int a, int b) {
			a = findSet(a);
			b = findSet(b);
			if (a == b)
				return true;
			return false;
		}

		int max() {
			int max = 0;
			for (int i = 0; i < size.length; i++)
				if (size[i] > max)
					max = size[i];
			return max;
		}

		void combine(int a, int b) {
			a = findSet(a);
			b = findSet(b);
			if (a == b)
				return;
			if (size[a] > size[b]) {
				p[b] = a;
				size[a] += size[b];

			} else {
				p[a] = b;
				size[b] += size[a];
			}
		}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

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

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

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

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

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

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

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

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

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

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}