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.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Random;
import java.util.StringTokenizer;


     
public class Solution{
    	
    	
    public static void main(String[] args) {
     
    	FastScanner fs = new FastScanner();
    	PrintWriter out = new PrintWriter(System.out);
    		
    		
    	int tt = 1;
    	while(tt-->0) {
    		
    		int n = fs.nextInt();
    		int m = fs.nextInt();
    		
    		
    		ArrayList<Interval> unsorted = new ArrayList<Interval>();
    		ArrayList<Interval> sorted = new ArrayList<Interval>();
    		
    		for(int i=0;i<m;i++) {
    			int t = fs.nextInt(), l = fs.nextInt(),r = fs.nextInt();
    			if(t==0) unsorted.add(new Interval(l,r));
    			else sorted.add(new Interval(l, r));
    		}
    		
    		Collections.sort(sorted);

    		
    		ArrayDeque<Interval> queue = new ArrayDeque<Interval>();
    		
    		for(int i=0;i<sorted.size();i++) {
    			if(queue.isEmpty()) queue.add(sorted.get(i));
    			else {
    				Interval pre = queue.getLast();
    				Interval cur = sorted.get(i);
    				if(cur.start<=pre.end) {
    					queue.removeLast();
    					queue.add(new Interval(pre.start, Math.max(cur.end, pre.end)));
    				}
    				else {
    					queue.add(cur);
    				}
    			}
    		}
    		
    		
    		int[] ans = new int[n+1];
    		
    		
    		int ind = 1;
    		int cur = n;
    		
    		for(Interval in : queue) {
    			while(ind<in.start) {
    				ans[ind++] = cur--;
    			}
    			for(int j=in.start;j<=in.end;j++)
    				ans[ind++] = cur;
    			cur--;
    		}
    		
    		
    		while(ind<=n)
    			ans[ind++] = cur--;
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		boolean bool = true;
    		for(Interval in: unsorted) {
    			if(ans[in.start]==ans[in.end]) {
    				bool = false;
    				break;
    			}
    		}
    		
    		if(!bool) {
    			out.println("NO");
    			out.flush();
    			return;
    		}
    		
    		out.println("YES");
    		for(int i=1;i<=n;i++) out.print(ans[i]+" ");
    		out.println();
    		
    	}
    		
    	out.close();
    		
    }
    
    
   
    
    static class Interval implements Comparable<Interval>{
    	int start;
    	int end;
    	Interval(int s, int e){
    		start = s;
    		end = e;
    	}
    	
    	@Override
    	public int compareTo(Interval o) {
    		return Integer.compare(this.start, o.start);
    	}
    	
    }
    
    	
    	
    static final Random random=new Random();
    	
    static void ruffleSort(int[] a) {
    	int n=a.length;//shuffle, then sort 
    	for (int i=0; i<n; i++) {
    		int oi=random.nextInt(n); int temp=a[oi];
    		a[oi]=a[i]; a[i]=temp;
    	}
    	Arrays.sort(a);
    }
    	
    	
    	
    static class FastScanner{
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringTokenizer st = new StringTokenizer("");
     
    	public String next(){
    		while(!st.hasMoreElements()){
    			try{
    				st = new StringTokenizer(br.readLine());
    			} catch(IOException e){
    				e.printStackTrace();
    			}
    		}
    		return st.nextToken();
    	}
    		
    	public String nextLine() throws IOException {
    		return br.readLine();
    	}
    		
    	public int nextInt(){
    		return Integer.parseInt(next());
    	}
     
    	public int[] readArray(int n){
    		int[] a = new int[n];
    		for(int i=0;i<n;i++)
    			a[i] = nextInt();
    		return a;
    	}
    		
    	public long nextLong() {
    		return Long.parseLong(next());
    	}
    		
    	public char nextChar() {
    		return next().toCharArray()[0];
    	}
    }
   	
}