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:
//package ContestEd67;

import java.io.*;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;

public class mainC {
    public static PrintWriter out = new PrintWriter(System.out);
    public static FastScanner enter = new FastScanner(System.in);

    public static void main(String[] args) throws IOException {
        int n=enter.nextInt();
        int m=enter.nextInt();
        pair type1[] =new pair[m];
        pair type0[] =new pair[m];
        int ans[]=new int[n+2];
        int last1=0;
        int last0=0;
        for (int i = 0; i <m ; i++) {
            if(enter.nextInt()==0){
                type0[last0]=new pair(enter.nextInt(),enter.nextInt());
                last0++;
            }
            else{
                type1[last1]=new pair(enter.nextInt(),enter.nextInt());
                last1++;
            }
        }
        sortMergeNoRecursive(type0,0,last0, pair.class,pair::compareTo);
        sortMergeNoRecursive(type1,0,last1, pair.class,pair::compareTo);
        ArrayList<pair> arr=new ArrayList<>();
        int last_r=-1;
        for (int i = 0; i <last1 ; i++) {
            if(type1[i].l>last_r){
                arr.add(new pair(type1[i].l,type1[i].r));
                last_r=type1[i].r;
            }
            else{
                if(type1[i].r>last_r){
                    pair gh=arr.get(arr.size()-1);
                    arr.remove(arr.size()-1);
                    gh=new pair(gh.l,type1[i].r);
                    arr.add(gh);
                    last_r=type1[i].r;
                }
            }
        }

        for (int i = 0; i <arr.size() ; i++) {
            ans[arr.get(i).l]=1;
            ans[arr.get(i).r]=-1;
        }
        ans[n+1]=1;
        
        if(last1==0){
            for (int i = 1; i <n+1 ; i++) {
                ans[i]=ans[i-1]-1;
            }
        }
        else{
            int u=0;
            int d=1;
            for (int i = 1; i <n+1 ; i++) {
                int tmp=ans[i];
                if(u==1){
                    ans[i]=ans[i-1]+1;
                }
                if(d==1){
                    ans[i]=ans[i-1]-1;
                }
                if(tmp==-1){
                    u=0;
                    d=1;
                }
                else if(tmp==1){
                    u=1;
                    d=0;
                }
            }
        }
        for (int i = 0; i <last0 ; i++) {
            int c=0;
            for (int j = type0[i].l; j <type0[i].r; j++) {
                if(ans[j]>ans[j+1]){
                    c=1;
                    break;
                }
            }
            if(c==0){
                out.println("NO");
                out.close();
                return;
            }
        }
        int min=Integer.MAX_VALUE;
        for (int i = 1; i <n+1 ; i++) {
            min=Math.min(min,ans[i]);
        }
        if(min<=0){
            for (int i = 1; i <n+1 ; i++) {
                ans[i]+=1-min;
            }
        }
        out.println("YES");
        for (int i = 1; i <n+1 ; i++) {
            out.print(ans[i]+" ");
        }
        out.close();

    }
    public static <T>  void sortMergeNoRecursive(T[] arr, int first, int last, Class<T> c, Comparator<T> comparator) {
        int len = last;
        int n = 1; // кратность сравнений (сравнивать по 1-му элем., 2-м ...)
        int shift; // сдвиг в перебираемом массиве
        int two_size; // количество элементов для 2-го массива
        T[] arr2;
        while (n < len) {
            shift = first;
            while (shift < len) {
                if (shift + n >= len) break;
                two_size = (shift + n * 2 > len) ? (len - (shift + n)) : n;
                arr2 = merge(Arrays.copyOfRange(arr, shift, shift + n),
                        Arrays.copyOfRange(arr, shift + n, shift + n + two_size),c,comparator);
                for (int i = 0; i < n + two_size; ++i)
                    arr[shift + i] = arr2[i]; // замена на отсортированное
                shift += n * 2;
            }
            n *= 2;
        }
    }

    public static <T> T[] merge(T[] arr_1, T[] arr_2,Class<T> c , Comparator<T> comparator) {
        int len_1 = arr_1.length, len_2 = arr_2.length;
        int a = 0, b = 0, len = len_1 + len_2; // a, b - счетчики в массивах
        //T[] result = new <>[len];
        T[] result=(T[]) Array.newInstance(c,len);


        for (int i = 0; i < len; i++) {
            if (b < len_2 && a < len_1) {
                if (comparator.compare(arr_1[a], arr_2[b]) > 0) result[i] = arr_2[b++];
                else result[i] = arr_1[a++];
            } else if (b < len_2) {
                result[i] = arr_2[b++];
            } else {
                result[i] = arr_1[a++];
            }
        }
        return result;
    }

    static class pair implements Comparable<pair>{
        int l;
        int r;

        public pair(int l, int r) {
            this.l = l;
            this.r = r;
        }

        @Override
        public int compareTo(pair o) {
            if(Integer.compare(l,o.l)!=0) return Integer.compare(l,o.l);
            else return Integer.compare(r,o.r);
        }
    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer stok;

        FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

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

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

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

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

        char nextChar() throws IOException {
            return (char) (br.read());
        }

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