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.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
        new Solver().solve();
    }

    static class Solver {
        StringBuilder sb = new StringBuilder();
        Scanner reader = new Scanner(System.in);
        //Reader reader = new Reader();
        List<Pair<Integer>> a = new ArrayList<>(), b = new ArrayList<>();

        void solve() throws IOException {
            int n = reader.nextInt(), m = reader.nextInt();
            while(m --> 0) {
                int t = reader.nextInt();
                Pair<Integer> pr = new Pair<Integer>(reader.nextInt() - 1, reader.nextInt() - 1);
                if(t == 1)
                    a.add(pr);
                else b.add(pr);
            }
            boolean[] u = new boolean[n - 1];
            for(Pair<Integer> pr : a) {
                for(int i = pr.a; i < pr.b; ++ i)
                    u[i] = true;
            }
            int tec = 10000000;
            int[] e = new int[n];
            e[0] = tec;
            for(int i = 0; i < n - 1; ++ i) {
                if(!u[i]) -- tec;
                e[i + 1] = tec;
            }
            for(Pair<Integer> pr : b) {
                boolean bl = false;
                for(int i = pr.a; i < pr.b; ++ i)
                    if(e[i] != e[pr.b]) {
                        bl = true;
                        break;
                    }
                if(!bl)
                    no();
            }
            writeln("YES");
            for(int o : e)
                write(o);
            System.out.println(sb);
        }

        class Pair<T> {
            T a, b;
            Pair(T a, T b) {
                this.a = a;
                this.b = b;
            }
        }

        void no() {
            System.out.println("NO");
            System.exit(0);
        }

        <T> void write(T ...objects) {
            for(int i = 0; i < objects.length; ++ i)
                sb.append(objects[i]).append(' ');
        }

        <T> void writeln(T ...objects) {
            if(objects.length == 0) sb.append('\n');
            for(T object : objects)
                sb.append(object).append('\n');
        }
    }

    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;private DataInputStream din;private byte[] buffer;private int bufferPointer, bytesRead;
        public Reader(){din=new DataInputStream(System.in);buffer=new byte[BUFFER_SIZE];bufferPointer=bytesRead=0;
        }public Reader(String file_name) throws IOException {din=new DataInputStream(new FileInputStream(file_name));buffer=new byte[BUFFER_SIZE];bufferPointer=bytesRead=0;
        }public String readLine() throws IOException{byte[] buf=new byte[64];int cnt=0,c;while((c=read())!=-1){if(c=='\n')break;buf[cnt++]=(byte)c;}return new String(buf,0,cnt);
        }public int nextInt() throws IOException{int ret=0;byte c=read();while(c<=' ')c=read();boolean neg=(c=='-');if(neg)c=read();do{ret=ret*10+c-'0';}while((c=read())>='0'&&c<='9');if(neg)return -ret;return ret;
        }public long nextLong() throws IOException{long ret=0;byte c=read();while(c<=' ')c=read();boolean neg=(c=='-');if(neg)c=read();do{ret=ret*10+c-'0';}while((c=read())>='0'&&c<='9');if(neg)return -ret;return ret;
        }public double nextDouble() throws IOException{double ret=0,div=1;byte c=read();while(c<=' ')c=read();boolean neg=(c=='-');if(neg)c = read();do {ret=ret*10+c-'0';}while((c=read())>='0'&&c<='9');if(c=='.')while((c=read())>='0'&&c<='9')ret+=(c-'0')/(div*=10);if(neg)return -ret;return ret;
        }private void fillBuffer() throws IOException{bytesRead=din.read(buffer,bufferPointer=0,BUFFER_SIZE);if(bytesRead==-1)buffer[0]=-1;
        }private byte read() throws IOException{if(bufferPointer==bytesRead)fillBuffer();return buffer[bufferPointer++];
        }public void close() throws IOException{if(din==null) return;din.close();}
    }
}