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 static java.util.Arrays.* ;
import static java.lang.Math.* ;

import java.lang.reflect.Array;
import java.util.*;
import java.io.*;

public class Main
{
    void main() throws Exception
    {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = sc.nextInt() ;
        int m = sc.nextInt() ;
        int [] ptr = new int [2] ;
        Query [][] q = new Query[2][m] ;
        UnionFind uf = new UnionFind(n) ;
        for(int i = 0 ;i  < m ; i++) {
            int t = sc.nextInt() ;
            q[t][ptr[t]++] =new Query(sc.nextInt() - 1, sc.nextInt() - 1);
        }
        int [] a = new int [n] ;

        for(int i = 0 ; i < ptr[1] ; i++)
        {
            Query c = q[1][i] ;
            int l= c.l ;
            int r = c.r ;
            for( ; l <= r ; l++)
                uf.unionSet(c.l , l) ;
        }

        TreeMap<Integer,Integer> map = new TreeMap<>();

        for(int i = n - 1 , id = 1; i >= 0 ;i--)
        {
            int p = uf.findSet(i) ;
            if(!map.containsKey(p))
                map.put(p , id ++) ;
        }
        for(int i = 0 ; i < n ;i++)
            a[i] = map.get(uf.findSet(i)) ;

        for(int i = 0 ; i < ptr[0] ; i++)
        {
            Query c = q[0][i] ;
            int l= c.l + 1;
            int r = c.r ;
            boolean can = false ;
            for( ; l <= r ; l++)
                can |= a[l - 1] > a[l] ;
            if(!can)
            {
                System.out.println("NO");
                return;
            }
        }
        for(int i = 0 ; i < ptr[1] ; i++)
        {
            Query c = q[1][i] ;
            int l= c.l + 1;
            int r = c.r ;
            boolean can = true ;
            for( ; l <= r ; l++) {
                can &= a[l - 1] <= a[l];
            }
            if(!can)
            {
                System.out.println("NO");
                return;
            }
        }

        out.println("YES");
        for(int x : a)
            out.print(x+" ");
        out.flush();
        out.close();
    }
    class UnionFind
    {
    	int numSets ,  p [] , rank [] , setSize[] ;

    	public UnionFind(int N)
    	{
    		p = new int[numSets = N];
    		rank = new int[N];
    		setSize = new int[N];
    		for (int i = 0; i < N; i++) {  p[i] = i; setSize[i] = 1; }
    	}

    	public int findSet(int i) { return p[i] == i ? i : (p[i] = findSet(p[i])); }

    	public boolean isSameSet(int i, int j) { return findSet(i) == findSet(j); }

    	public boolean unionSet(int i, int j)
    	{
    		if (isSameSet(i, j))
    			return false;
    		numSets--;
    		int x = findSet(i), y = findSet(j);
    		if(rank[x] > rank[y]) { p[y] = x; setSize[x] += setSize[y]; }
    		else
    		{	p[x] = y; setSize[y] += setSize[x];
    			if(rank[x] == rank[y]) rank[y]++;
    		}
    		return true ;
    	}

    	public int numDisjointSets() {return numSets;}

    	public int sizeOfSet(int i) {return setSize[findSet(i)];}
    }
    class Query implements Comparable<Query>
    {
        int l , r ;
        Query(int a , int b)
        {
            l = a ;
            r = b ;
        }

        @Override
        public int compareTo( Query o) {
            return l - o.l;
        }
    }

    public static void main (String [] args) throws Exception
    {
        new Main().main();
    }

    class Scanner
    {
        BufferedReader br;
        StringTokenizer st;

        Scanner(InputStream in)
        {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

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

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

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

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