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.util.*;
import java.io.*;
import java.io.FileWriter; 

// Solution

public class Main 
{    
  public static void main (String[] argv) throws IOException
  {
	  new Main();
  } 
     
    
  
  boolean test = false;  
  
  final int MOD = 998244353;  //1000000007;
  
  
  class Flat implements Comparable<Flat> {
      int lo, hi;
      public Flat(int l, int h)
      {
          lo = l;
          hi = h;
      }
      
      @Override
      public int compareTo(Flat o)
      {
          if (lo != o.lo) return lo - o.lo;
          return hi - o.hi;
      }
  }
  
  class Down implements Comparable<Down> {
      int lo, hi;
      public Down(int l, int h)
      {
          lo = l;
          hi = h;
      }
      
      @Override
      public int compareTo(Down o)
      {          
          return hi - o.hi;
      }
  }
  
  
  public Main()   {
	FastReader in = new FastReader(new BufferedReader(new InputStreamReader(System.in)));
	
     
    //FastReader in = new FastReader(new BufferedReader(new FileReader("Main.in")));
    int n = in.nextInt();
    int m = in.nextInt();
    final int TYPE_FLAT = 1;
    final int TYPE_DOWN = 0;
    
    List<Flat> flats = new ArrayList<>();
    List<Down> downs = new ArrayList<>();
    for (int i = 0; i < m; i++)
    {
        int type = in.nextInt();
        int lo = in.nextInt() - 1;
        int hi = in.nextInt() - 1;
        
        if (type == TYPE_FLAT)
            flats.add(new Flat(lo, hi));
        else
            downs.add(new Down(lo, hi));
    }
    
    Collections.sort(flats);
    Collections.sort(downs);
    
    //merge flats
    List<Flat> mflats = new ArrayList<>();
    if (flats.size() != 0)
    {
        int lo = flats.get(0).lo;
        int hi = flats.get(0).hi;
        
        for (int i = 1; i < flats.size(); i++)
        {
            int clo = flats.get(i).lo, chi = flats.get(i).hi;
            if (clo <= hi)
                hi = Math.max(hi, chi);
            else {
                //store
                mflats.add(new Flat(lo, hi));
                lo = clo;
                hi = chi;
            }
        }
        // the last one
        mflats.add(new Flat(lo, hi));
    }
    
    int nf = mflats.size();
    int pf = 0;
    
    int lastFilled = 0;
    int lastDown = -1;
    
    int[] a = new int[n];
    a[0] = 2000;
    boolean ok = true;
    for (Down down : downs)
    {
        int l = down.lo, r = down.hi;
        
        if (lastDown > l) continue;
        
        while (pf < nf && mflats.get(pf).lo < r) pf++;
        
        
        if (pf == 0 || mflats.get(pf - 1).hi < r) {
            paint(a, lastFilled + 1, r - 1);
            a[r] = a[r-1] - 1;
            lastFilled = r;
            lastDown = r;
        }else {
            if (l >= mflats.get(pf - 1).lo) {
                ok = false;
                break;
            }
            
            int pd = mflats.get(pf - 1).lo;
            paint(a, lastFilled + 1, pd - 1);
            a[pd] = a[pd-1] - 1;
            lastFilled = pd;
            lastDown = pd;            
        }        
    }
    
    if (!ok) System.out.println("NO");
    else {
        System.out.println("YES");
        paint(a, lastFilled + 1, n-1);
        for (int v : a) System.out.print(v + " ");
        System.out.println();
    }
    
  }
  
  private void paint(int[] a, int l, int r)
  {
      int v = a[l-1];
      for (int i = l; i <= r; i++) a[i] = v;
  }
  
  private boolean isOval(char c)
  {
      return c == 'A' || c =='E' || c == 'I' || c == 'O' || c == 'Y' || c == 'U';
  }
 
 
  private int mod_add(int a, int b) {
      int v = a + b;
      if (v >= MOD) v -= MOD;
      return v;
  }
  
  
  private long overlap(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) {
      if (x1 > x3) return overlap(x3, y3, x4, y4, x1, y1, x2, y2);
      
      if (x3 > x2 || y4 < y1 || y3 > y2) return 0L;
      
      //(x3, ?, x2, ?)
      int yL = Math.max(y1, y3);
      int yH = Math.min(y2, y4); 
      int xH = Math.min(x2, x4);
      
      return f(x3, yL, xH, yH);
  }
  //return #black cells in rectangle
  private long f(int x1, int y1, int x2, int y2) {
      long dx = 1L + x2 - x1;
      long dy = 1L + y2 - y1;
      if (dx % 2 == 0 || dy % 2 == 0 || (x1 + y1) % 2 == 0) 
          return 1L * dx * dy / 2;
      return 1L * dx * dy / 2 + 1;
  }
  
  private int dist(int x, int y, int xx, int yy) {
      return abs(x - xx) + abs(y - yy);
  }
  
  private boolean less(int x, int y, int xx, int yy) {
      return x < xx || y > yy;
  }
  
  private int mul(int x, int y) {
      return (int)(1L * x * y % MOD);
  }
  
  private int add(int x, int y) {
      return (x + y) % MOD;
  }
  
 
  
  private int nBit1(int v) {
      int v0 = v;
      int c = 0;
      while (v != 0) {
          ++c;
          v = v & (v - 1);
      }
      return c;
  }
  
  private long abs(long v) {
      return v > 0 ? v : -v;
  }
  
  private int abs(int v) {
      return v > 0 ? v : -v;
  }
  
  private int common(int v) {
      int c = 0;
      while (v != 1) {
          v = (v >>> 1);
          ++c;
      }
      
      return c;
  }
  
  private void reverse(char[] a, int i, int j) {
      while (i < j) {
          swap(a, i++, j--);
      }
  }
  
  private void swap(char[] a, int i, int j) {
      char t = a[i];
      a[i] = a[j];
      a[j] = t;
  }
  
  private int gcd(int x, int y) {
      if (y == 0) return x;
      return gcd(y, x % y);
  }
  private long gcd(long x, long y) {
      if (y == 0) return x;
      return gcd(y, x % y);
  }
  private int max(int a, int b) {
      return a >  b ? a : b;
  }
  
  private long max(long a, long b) {
      return a >  b ? a : b;
  }
  
  private int min(int a, int b) {
      return a >  b ? b : a;
  }
  
  private long min(long a, long b) {
      return a >  b ? b : a;
  }
  
  static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;
 
        public FastReader(BufferedReader in)
        {            
            br = in;
        }
 
        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    String line = br.readLine();
                    if (line == null || line.length() == 0) return "";
                    st = new StringTokenizer(line);
                }
                catch (IOException  e)
                {
                    return "";
                    //e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt()
        {
            return Integer.parseInt(next());
        }
 
        long nextLong()
        {
            return Long.parseLong(next());
        }
 
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
 
        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                return null;
                //e.printStackTrace();
            }
            return str;
        }
    }
}