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:
/*
9 2
        1 1 1 1 1 0 0 0 0
        1 2
        1 5
        5 6
        5 7
        2 3
        2 4
        3 8
        3 9
*/
 
 
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;
 
public class Question {
    static boolean[] v1;
    static boolean[] v2;
    static LinkedList<Integer> adj[];
    static  int[] d1;
    static  int[] d2;
    static  int[] dp;
    static  int[][] next;
 
 
    public static void main(String[] args) throws IOException {
        Reader.init(System.in);
        /*int n = Reader.nextInt();
        adj = new LinkedList[n+1];
        for (int i = 0 ; i < n+1 ; i++){
            adj[i] = new LinkedList<>();
        }
        int[] destroy = new int[n+1];
 
        for (int i = 0 ; i < n-1 ; i++){
            int n1 = Reader.nextInt();
            int n2 = Reader.nextInt();
            int n3 = Reader.nextInt();
            adj[n1].addLast(n2);
            adj[n2].addLast(n1);
            destroy[n1] = n3;
            destroy[n2] = n3;
        }
        LinkedList<Integer> list = new LinkedList<>();
        LinkedList<Integer> q = new LinkedList<>();
        for (int i = 0 ; i < n+1 ; i++){
            if (i!=1){
                if (adj[i].size()==1){
                    q.addLast(i);
                    //System.out.println(i);
                }
            }
        }
        boolean visited[] = new boolean[n+1];
        int cnt = 0;
        while (q.isEmpty()==false){
            int child = q.removeFirst();
            int flag = 0;
            if (destroy[child]==1){
                flag = 1;
                cnt++;
                list.add(child);
                System.out.println("child " + child );
                destroy[child] = 0;
            }
            Iterator i = adj[child].iterator();
            while (i.hasNext()){
                int node = (int)i.next();
                if ((!visited[node])){
                    visited[node] = true;
                    if (flag==0&&destroy[node]==1){
                        flag =1;
                        cnt++;
                        System.out.println("He " + child + " " + node);
                        list.add(node);
                    }
                    i = adj[node].iterator();
                }
                else{
                    break;
                }
            }
        }
        System.out.println(cnt);
        while (list.isEmpty()==false){
            System.out.print(list.removeFirst()+ " ");
        }
        System.out.println();*/
        int n = Reader.nextInt();
        int m = Reader.nextInt();
        int[] arr = new int[n];
        int cnt = 2*1000000;
        for (int i = 0 ; i < n ; i++){
            arr[i] = cnt;
            cnt--;
        }
        int[][] query = new int[m][3];
        //System.out.println(Arrays.toString(arr));
        for (int i = 0 ; i < m ; i++){
            query[i][0] = Reader.nextInt();
            query[i][1] = Reader.nextInt()-1;
            query[i][2] = Reader.nextInt()-1;
        }
 
        sortbyColumn(query,1);
        //System.out.println(Arrays.deepToString(query));
 
        for (int i = 0 ; i < m ; i++){
            if (query[i][0]==1){
                int left = query[i][1];
                int right = query[i][2];
                int flag = 0;
                int number = 1;
                for (left = left+1 ; left<=right ; left++){
                    arr[left] = arr[left-1]+1;
                }
                //System.out.println(Arrays.toString(arr));
            }
        }
 
        for (int i = 0 ; i < m ; i++){
            if (query[i][0]==0){
                int left = query[i][1];
                int right = query[i][2];
                int flag = 0;
                for (left = left ; left<right ; left++){
                    if (arr[left]>arr[left+1]){
                        flag=1;
                    }
                }
                if (flag==0){
                    System.out.println("NO");
                    System.exit(0);
                }
            }
        }
 
        System.out.println("YES");
        for (int i = 0 ; i < n ; i++){
            System.out.print(arr[i] + " ");
        }
        System.out.println();
 
 
 
 
 
 
    }
    static int fun1(int i , int j , int t1 , int t2){
        Arrays.fill(dp,-1);
        return fun(i,j,t1,t2);
    }
    static int fun(int i , int j,int t1,int t2){
        if (i>=j){
            return 0;
        }
        else if (dp[i]!=-1){
            //System.out.println(dp[i] + " " + i);
            return dp[i];
        }
        dp[i] = Math.min(t1 + fun(next[i][0]+1,j,t1,t2),t2 + fun(next[i][1]+1,j,t1,t2));
        return dp[i];
    }
 
    static void rowSwap(int[][] arr , int x , int y,int m , int n){
        for (int i = 0 ; i < m ; i++){
            int temp = arr[x][i];
            arr[x][i] = arr[y][i];
            arr[y][i] = temp;
        }
    }
 
 
    static void colSwap(int[][] arr , int x , int y,int m , int n){
        for (int i = 0 ; i < n ; i++){
            int temp = arr[i][x];
            arr[i][x] = arr[i][y];
            arr[i][y] = temp;
        }
    }
 
    static void dfsA(int v,int dis){
        //System.out.println(v);
        //System.out.println(v1.length);
        v1[v] = true;
        d1[v] = dis;
 
        Iterator<Integer> i = adj[v].listIterator();
        while (i.hasNext()){
            int n = i.next();
            if (!v1[n]){
                dfsA(n,dis+1);
            }
        }
 
    }
 
    static void dfsB(int v,int dis){
        v2[v] = true;
        d2[v] = dis;
 
        Iterator<Integer> i = adj[v].listIterator();
        while (i.hasNext()){
            int n = i.next();
            if (!v2[n]){
                dfsB(n,dis+1);
            }
        }
 
    }
 
 
    public static void sortbyColumn(int arr[][], int col)
    {
        // Using built-in sort function Arrays.sort
        Arrays.sort(arr, new Comparator<int[]>() {
 
            @Override
            // Compare values according to columns
            public int compare(final int[] entry1,
                               final int[] entry2) {
 
                // To sort in descending order revert
                // the '>' Operator
                if (entry1[col] > entry2[col])
                    return 1;
                else
                    return -1;
            }
        });  // End of function call sort().
    }
}
 
class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;
 
    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }
 
    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    }
 
    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }
    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }
 
    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
}
 
class MergeSort
{
    // Merges two subarrays of arr[].
    // First subarray is arr[l..m]
    // Second subarray is arr[m+1..r]
    void merge(int arr[], int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;
 
        /* Create temp arrays */
        int L[] = new int [n1];
        int R[] = new int [n2];
 
        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];
 
 
        /* Merge the temp arrays */
 
        // Initial indexes of first and second subarrays
        int i = 0, j = 0;
 
        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }
 
        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }
 
        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }
 
    // Main function that sorts arr[l..r] using
    // merge()
    void sort(int arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;
 
            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);
 
            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }
 
    /* A utility function to print array of size n */
    static void printArray(int arr[])
    {
        int n = arr.length;
        for (int i=0; i<n; ++i)
            System.out.print(arr[i] + " ");
        System.out.println();
    }
 
    // Driver method
}
 
class Node{
    int data;
    int freq;
 
    public Node(int data, int freq) {
        this.data = data;
        this.freq = freq;
    }
 
}
class GFG {
 
    // limit for array size
    static int N = 1000000;
 
    static int n; // array size
 
    // Max size of tree
    static int []tree = new int[2 * N];
 
    // function to build the tree
    static void build( char []arr,int n)
    {
 
        // insert leaf nodes in tree
        for (int i = 0; i < n-1; i++) {
            if (arr[i]!=arr[i+1]) {
                System.out.println(i);
                tree[n + i] = 1;
            }
        }
 
        // build the tree by calculating
        // parents
        for (int i = n - 1; i > 0; --i)
            tree[i] = tree[i << 1] +
                    tree[i << 1 | 1];
    }
 
    static int query(int l, int r)
    {
        int res = 0;
 
        // loop to find the sum in the range
        for (l += n, r += n; l < r;
             l >>= 1, r >>= 1)
        {
            if ((l & 1) > 0)
                res += tree[l++];
 
            if ((r & 1) > 0)
                res += tree[--r];
        }
//  
        return res;
    }
 
    // driver program to test the
    // above function
 
}