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

Difficulty: MEDIUM_HARD

Solutions:
(n, m) = map(int, input().split(' '))
a = [[0, 0, 0] for i in range(m + 1)]
mark = [False] * (n + 1)
for i in range(1, m + 1):
	(a[i][0], a[i][1], a[i][2]) = map(int, input().split(' '))
	if a[i][0]:
		for j in range(a[i][1], a[i][2]):
			mark[j] = True
finally_failed = False
for i in range(1, m + 1):
	flag = False
	if not a[i][0]:
		for j in range(a[i][1], a[i][2]):
			if not mark[j]:
				flag = True
				break
		if not flag:
			print('NO')
			finally_failed = True
			break
if not finally_failed:
	cur_value = n + 1
	output_list = list()
	for i in range(1, n + 1):
		if not mark[i - 1]:
			cur_value -= 1
		output_list.append(str(cur_value))
	print('YES')
	print(' '.join(output_list))


from collections import defaultdict, deque, Counter
from sys import stdin, stdout
from heapq import heappush, heappop
import math
import io
import os
import math
import bisect

def isPrime(x):
	for i in range(2, x):
		if i * i > x:
			break
		if x % i == 0:
			return False
	return True

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(n)
	return list(set(l))

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def digits(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def ceil(n, x):
	if n % x == 0:
		return n // x
	return n // x + 1

def mapin():
	return map(int, input().split())
(n, m) = mapin()
d = [-1] * n
io = [[], []]
for i in range(m):
	(t, l, r) = mapin()
	l -= 1
	r -= 1
	io[t].append([l, r])
	if t == 1:
		for j in range(l, r):
			d[j] = 0
fl = 1
a = [0] * n
a[0] = n
for i in range(1, n):
	a[i] = a[i - 1] + d[i - 1]
for i in io[1]:
	ff = 1
	for j in range(i[0], i[1]):
		if a[j] <= a[j + 1]:
			continue
		ff = 0
		break
	if ff == 0:
		fl = 0
		break
for i in io[0]:
	ff = 0
	for j in range(i[0], i[1]):
		if a[j] > a[j + 1]:
			ff = 1
			break
	if ff == 0:
		fl = 0
		break
if fl:
	print('YES')
	print(*a)
else:
	print('NO')


def solve():
	(n, m) = input().split()
	n = int(n)
	m = int(m)
	sorted_bounds = []
	unsorted_bounds = []
	for i in range(m):
		(t, l, r) = input().split()
		if int(t) == 1:
			sorted_bounds.append([int(l), int(r)])
		else:
			unsorted_bounds.append([int(l), int(r)])
	for i in range(len(unsorted_bounds)):
		for j in range(len(sorted_bounds)):
			if is_inside(sorted_bounds[j], unsorted_bounds[i]):
				print('NO')
				quit()
	r = [0] * (n - 1)
	for b in sorted_bounds:
		r[b[0] - 1:b[1] - 1] = [1] * (b[1] - b[0])
	a = [0] * n
	current = n
	a[0] = current
	for i in range(n - 1):
		if r[i] == 0:
			current -= 1
		a[i + 1] = current
	for b in unsorted_bounds:
		if a[b[0] - 1] == a[b[1] - 1]:
			print('NO')
			quit()
	print('YES')
	print(' '.join(map(str, a)))

def is_inside(f, s):
	return f[0] <= s[0] and s[1] <= f[1]
solve()


import sys
input = sys.stdin.readline
(n, m) = map(int, input().split())
(q1, q0) = ([], [])
for i in range(m):
	(t, l, r) = map(int, input().split())
	l -= 1
	r -= 1
	if t == 1:
		q1.append([l, r])
	else:
		q0.append([l, r])
b = [-1] * (n - 1)
for (l, r) in q1:
	for j in range(l, r):
		b[j] = 0
a = [0] * n
a[0] = n
for i in range(1, n):
	a[i] = a[i - 1] + b[i - 1]
flag = 1
for (l, r) in q0:
	if all((a[i] == a[i + 1] for i in range(l, r))):
		flag = 0
if flag:
	print('YES')
	print(*a)
else:
	print('NO')


from sys import stdin
read = stdin.readline
(n, m) = map(int, read().split())
ans = [0] * n
nd = []
for i in range(m):
	(t, l, r) = map(int, read().split())
	if t:
		for j in range(l, r):
			ans[j] = 1
	else:
		nd.append((l, r))
can = True
for (l, r) in nd:
	if all(ans[l:r]):
		can = False
		break
if can:
	res = [n] * n
	for i in range(1, n):
		res[i] = res[i - 1] + ans[i] - 1
	print('YES')
	print(' '.join(map(str, res)))
else:
	print('NO')


(n, m) = map(int, input().split())
B = [-1] * (n - 1)
TLR = []
for i in range(m):
	(t, l, r) = map(int, input().split())
	(l, r) = (l - 1, r - 1)
	TLR.append((t, l, r))
	if t == 1:
		for j in range(l, r):
			B[j] = 0
A = [0] * n
A[0] = n
for i in range(n - 1):
	A[i + 1] = A[i] + B[i]
flag = True
for (t, l, r) in TLR:
	if t == 1:
		for i in range(l + 1, r + 1):
			if A[i] < A[i - 1]:
				flag = False
	else:
		flag2 = False
		for i in range(l + 1, r + 1):
			if A[i] < A[i - 1]:
				flag2 = True
		if not flag2:
			flag = False
if flag:
	print('YES')
	print(*A)
else:
	print('NO')