#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<set>
#define ll long long
using namespace std;
const int maxn = 201000;
const int inf = 0x3f3f3f3f;
#define fr(i,r,l) for(int i=r;i<=l;i++)
int a[maxn];
int main()
{
	int n, t;
	cin >> n >> t;
	int lazy = 0;
	memset(a, 0, sizeof(a));
	int b[1010][5];
	fr(i, 1 ,t)
	{
		scanf("%d %d %d", &b[i][0], &b[i][1], &b[i][2]);
		if (b[i][0])
		{
			fr(j, b[i][1] + 1, b[i][2])
			{
				a[j] = 1;
			}
		}
	}
	fr(i, 1, t)
	{
		if (!b[i][0])
		{
			bool p = 0;
			fr(j, b[i][1] + 1, b[i][2])
			{
				if (a[j] == 0)
					p = 1;
				break;
			}
			if (p == 0)
			{
				printf("NO\n");
				return 0;
			}
		}
	}
	a[1] = 2000;
	printf("YES\n");
	fr(i, 2, n)
	{
		if (a[i]==1)
		{
			a[i] = a[i-1] ;
		}
		else
		{
			a[i] = a[i - 1] - 1;
		}
	}
	fr(i, 1, n)printf("%d ", a[i]);
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<set>
#define ll long long
using namespace std;
const int maxn = 201000;
const int inf = 0x3f3f3f3f;
int a[maxn];
int main()
{
	int n, t;
	cin >> n >> t;
	for (int i = 1;i <= n;i++)
	{
		a[i] = i;
	}
	int lazy = 0;
	int flag[maxn];
	memset(flag, 0, sizeof(flag));
	while (t--)
	{
		int x, l, r;
		cin >> x >> l >> r;
		if (lazy == 1)continue;
		if (x == 1)
		{
			for (int i = l+1;i < r;i++)
			{
				if (flag[i] == 1)
				{
					lazy = 1;
					break;
				}
				flag[i] = 1;
			}
		}
		if (x == 0)
		{
			for (int i = l;i <= r;i++)
			{
				if (flag[i] == 1)
				{
					lazy = 1;
					break;
				}
				flag[i] = 1;
				if(i!=l)
				a[i] = i - 2;
			}
		}
	}
	if (lazy == 1)printf("NO\n");
	else
	{
		printf("YES\n");
		for (int i = 1;i <= n;i++)
		{
			printf("%d", a[i]);
			if (i != n)printf(" ");
		}
	}
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<set>
#define ll long long
using namespace std;
const int maxn = 201000;
const int inf = 0x3f3f3f3f;
int a[maxn];
int main()
{
	int n, t;
	cin >> n >> t;
	for (int i = 1;i <= n;i++)
	{
		a[i] = i;
	}
	int lazy = 0;
	int flag[maxn];
	memset(flag, 0, sizeof(flag));
	while (t--)
	{
		int x, y, z;
		cin >> x >> y >> z;
		if (x == 1)
		{
			for (int i = y+1;i <= z;i++)
			{
					flag[i] = 1;
			}
		}
		if (x == 0)
		{
			int qwer = 0;
			for (int i = y;i <= z;i++)
			{
				if (flag[i] == 0)qwer = 1;
			}
			if (qwer == 0)lazy = 1;
		}
	}
	if (lazy == 1)printf("NO\n");
	else
	{
		printf("YES\n");
		for (int i = 1;i <= n;i++)
		{
			if (flag[i] == 0&&i!=1)
				printf("%d", i - 2);
			else printf("%d", i);
			if (i != n)printf(" ");
		}
	}
}


#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define fi first
#define se second
#define pb push_back

using namespace std;

int n, m, a[1009];
pair <pii, int> b[1009];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	cin >> n >> m;

	for(int i = 0; i < n; i++) a[i] = 1;

	for(int i = 0; i < m; i++) {
		int t, l, r;
		cin >> t >> l >> r;
		r--;
		b[i].se = t;
		b[i].fi = {l, r};
	}

	for(int i = 0; i < m; i++) {
		if(b[i].se == 1) {
			for(int j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				a[j] = 2000;
			}
		}
	}
	bool bisa = 1;
	for(int i = 0; i < m; i++) {
		if(b[i].se == 0) {
			bool yes = 0;
			for(int j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				if(a[j] != 2000) {
					yes = 1;
				}
			}
			if(!yes) bisa = 0;
		}
	}
	if(!bisa) {
		cout << "NO";
		return 0;
	}

	int temp = 2000;
	for(int i = 0; i < m; i++) {
		if(b[i].se == 0) {
			for(int j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				if(a[j] != 2000) {
					a[j] = --temp;
				}
			}
		}
	}
	cout << "YES\n";
	for(int i = 0; i < n; i++) {
		cout << a[i] << ' ';
	}
}


#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define fi first
#define se second
#define pb push_back

using namespace std;

ll n, m, a[1009];
pair <pii, ll> b[1009];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	cin >> n >> m;

	for(ll i = 0; i < n; i++) a[i] = 1;

	for(ll i = 0; i < m; i++) {
		ll t, l, r;
		cin >> t >> l >> r;
		r--;
		b[i].se = t;
		b[i].fi = {l, r};
	}

	for(ll i = 0; i < m; i++) {
		if(b[i].se == 1) {
			for(ll j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				a[j] = 2000;
			}
		}
	}
	bool bisa = 1;
	for(ll i = 0; i < m; i++) {
		if(b[i].se == 0) {
			bool yes = 0;
			for(ll j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				if(a[j] != 2000) {
					yes = 1;
				}
			}
			if(!yes) bisa = 0;
		}
	}
	if(!bisa) {
		cout << "NO";
		return 0;
	}

	ll temp = 2000;
	for(ll i = 0; i < m; i++) {
		if(b[i].se == 0) {
			for(ll j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				if(a[j] != 2000) {
					a[j] = --temp;
				}
			}
		}
	}
	cout << "YES\n";
	for(ll i = 0; i < n; i++) {
		cout << a[i] << ' ';
	}
}


#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define fi first
#define se second
#define pb push_back

using namespace std;

ll n, m, a[1009];
bool srtd[1009];
pair <pii, ll> b[1009];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	cin >> n >> m;

	for(ll i = 0; i < n; i++) a[i] = 500000000;

	for(ll i = 0; i < m; i++) {
		ll t, l, r;
		cin >> t >> l >> r;
		r--;
		b[i].se = t;
		b[i].fi = {l, r};
	}

	for(ll i = 0; i < m; i++) {
		if(b[i].se == 1) {
			for(ll j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				srtd[j] = 1;
			}
		}
	}
	bool bisa = 1;
	for(ll i = 0; i < m; i++) {
		if(b[i].se == 0) {
			bool yes = 0;
			for(ll j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				if(!srtd[j]) {
					yes = 1;
				}
			}
			if(!yes) bisa = 0;
		}
	}
	if(!bisa) {
		cout << "NO";
		return 0;
	}

	a[0] = 500000000;
	ll temp = 500000000;
	for(ll i = 0; i < m; i++) {
		if(b[i].se == 0) {
			for(ll j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				if(!srtd[j]) {
					a[j] = --temp;
				}
			}
		}
	}
	cout << "YES\n";
	for(ll i = 0; i < n; i++) {
		cout << a[i] << ' ';
	}
}


#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define fi first
#define se second
#define pb push_back

using namespace std;

ll n, m, a[1009];
pair <pii, ll> b[1009];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	cin >> n >> m;

	for(ll i = 0; i < n; i++) a[i] = 1;

	for(ll i = 0; i < m; i++) {
		ll t, l, r;
		cin >> t >> l >> r;
		r--;
		b[i].se = t;
		b[i].fi = {l, r};
	}

	for(ll i = 0; i < m; i++) {
		if(b[i].se == 1) {
			for(ll j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				a[j] = 30000;
			}
		}
	}
	bool bisa = 1;
	for(ll i = 0; i < m; i++) {
		if(b[i].se == 0) {
			bool yes = 0;
			for(ll j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				if(a[j] != 30000) {
					yes = 1;
				}
			}
			if(!yes) bisa = 0;
		}
	}
	if(!bisa) {
		cout << "NO";
		return 0;
	}

	a[0] = 30000;
	ll temp = 30000;
	for(ll i = 0; i < m; i++) {
		if(b[i].se == 0) {
			for(ll j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				if(a[j] != 30000) {
					a[j] = --temp;
				}
			}
		}
	}
	cout << "YES\n";
	for(ll i = 0; i < n; i++) {
		cout << a[i] << ' ';
	}
}


#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define fi first
#define se second
#define pb push_back

using namespace std;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	int n, m; cin >> n >> m;
	bool bisa = 1;
	int c[1009];
	for(int i = 0; i < 1005; i++)
	c[i] = 0;
	for(int i = 0; i < m; i++)
	{
		int x, y, z;
		cin >> x >> y >> z;
		for(int j = y+1; j <= z; j++)
		{
			if(x==0)
			{
				if(c[j] == 1)
				bisa = 0;
				c[j] = -1;
			}else {
				if(c[j] == -1)
				bisa = 0;
				c[j] = 1;
			}
		}
	}
	if(!bisa)
	{
		cout << "NO";
		return 0;
	}
	cout << "YES\n";
	int temp = 10000;
	for(int i = 1; i <= n; i++)
	{
		if(c[i] == -1)
		{
			cout << --temp << " ";
		}cout << temp << " ";
	}
}


#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define fi first
#define se second

using namespace std;

int n, m, tmp[1009];
pair <int, pii > a[1009];

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	cin >> n >> m;
	for(int i = 0; i < m; i++)
	{
		cin >> a[i].fi >> a[i].se.fi >> a[i].se.se;
	}

	for(int i = 0; i < 1005; i++)
	{
		tmp[i] = 0;
	}
	for(int i = 0; i < m; i++)
	{
		int l = a[i].se.fi, r = a[i].se.se;
		if(a[i].fi == 1)
		{
			for(int j = l + 1; j <= r-1; j++)
			{
				if(tmp[j] == -1)
				{
					cout << "NO";
					return 0;
				}
			}
			if(l == r-1)
			{
				if(tmp[l] == tmp[r] and tmp[l] == -1)
				{
					cout << "NO";
					return 0;
				}
			}
			if(tmp[l] == -1)
			tmp[l] = 5;
			if(tmp[r] == -1)
			tmp[l] = 5;
			for(int j = l; j <= r; j++)
			{
				if(tmp[j] == 5)
				continue;
				tmp[j] = 1;
			}
		}
		if(a[i].fi == 0)
		{
			for(int j = l + 1; j <= r-1; j++)
			{
				if(tmp[j] == 1)
				{
					cout << "NO";
					return 0;
				}
			}
			if(l == r-1)
			{
				if(tmp[l] == tmp[r] and tmp[l] == 1)
				{
					cout << "NO";
					return 0;
				}
			}
			if(tmp[l] == 1)
			tmp[l] = 5;
			if(tmp[r] == 1)
			tmp[l] = 5;
			for(int j = l; j <= r; j++)
			{
				if(tmp[j] == 5)
				continue;
				tmp[j] = -1;
			}
		}
	}
	cout << "YES\n";
	int prev = tmp[1], prev2, temp;
	tmp[1] = 10000;
	cout << 10000 << " ";
	for(int i = 2; i <= n; i++)
	{
		temp = tmp[i];
		if(tmp[i] == 1)
		{
			tmp[i] = tmp[i-1];
		}
		if(tmp[i] == -1)
		{
			tmp[i] = tmp[i-1]-1;
		}
		if(tmp[i] == 5)
		{
			if(prev != 5)
			{
				if(prev2 == -1)
				{
					tmp[i] = tmp[i-1]-1;
				}
				if(prev2 == 1)
				{
					tmp[i] = tmp[i-1];
				}
			}else {
				if(prev2 == -1)
				{
					tmp[i] = tmp[i-1];
				}
				if(prev2 == 1)
				{
					tmp[i] = tmp[i-1]-1;
				}
			}
		}
		if(tmp[i] == 0)
		{
			tmp[i] = tmp[i-1];
		}
		cout << tmp[i] << " ";

		prev2 = prev;
		prev = temp;
	}
}


#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define fi first
#define se second
#define pb push_back

using namespace std;

ll n, m, a[1009];
pair <pii, ll> b[1009];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	cin >> n >> m;

	for(ll i = 0; i < n; i++) a[i] = 1;

	for(ll i = 0; i < m; i++) {
		ll t, l, r;
		cin >> t >> l >> r;
		r--;
		b[i].se = t;
		b[i].fi = {l, r};
	}

	for(ll i = 0; i < m; i++) {
		if(b[i].se == 1) {
			for(ll j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				a[j] = 500000000;
			}
		}
	}
	bool bisa = 1;
	for(ll i = 0; i < m; i++) {
		if(b[i].se == 0) {
			bool yes = 0;
			for(ll j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				if(a[j] != 500000000) {
					yes = 1;
				}
			}
			if(!yes) bisa = 0;
		}
	}
	if(!bisa) {
		cout << "NO";
		return 0;
	}

	a[0] = 500000000;
	ll temp = 500000000;
	for(ll i = 0; i < m; i++) {
		if(b[i].se == 0) {
			for(ll j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				if(a[j] != 500000000) {
					a[j] = --temp;
				}
			}
		}
	}
	cout << "YES\n";
	for(ll i = 0; i < n; i++) {
		cout << a[i] << ' ';
	}
}


#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define fi first
#define se second
#define pb push_back

using namespace std;

ll n, m, a[1009];
bool srtd[1009];
pair <pii, ll> b[1009];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	cin >> n >> m;

	for(ll i = 0; i < n; i++) a[i] = 500000000;

	for(ll i = 0; i < m; i++) {
		ll t, l, r;
		cin >> t >> l >> r;
		r--;
		b[i].se = t;
		b[i].fi = {l, r};
	}
	sort(b, b + m);
	for(ll i = 0; i < m; i++) {
		if(b[i].se == 1) {
			for(ll j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				srtd[j] = 1;
			}
		}
	}
	bool bisa = 1;
	for(ll i = 0; i < m; i++) {
		if(b[i].se == 0) {
			bool yes = 0;
			for(ll j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				if(!srtd[j]) {
					yes = 1;
				}
			}
			if(!yes) bisa = 0;
		}
	}
	if(!bisa) {
		cout << "NO";
		return 0;
	}

	a[0] = 500000000;
	ll temp = 500000000;
	for(ll i = 0; i < m; i++) {
		if(b[i].se == 0) {
			for(ll j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				if(!srtd[j]) {
					a[j] = --temp;
				}
			}
		}
	}
	cout << "YES\n";
	for(ll i = 0; i < n; i++) {
		cout << a[i] << ' ';
	}
}


#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define fi first
#define se second
#define pb push_back

using namespace std;

int n, m, a[1009];
pair <pii, int> b[1009];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	cin >> n >> m;

	for(int i = 0; i < n; i++) a[i] = 0;

	for(int i = 0; i < m; i++) {
		int t, l, r;
		cin >> t >> l >> r;
		r--;
		b[i].se = t;
		b[i].fi = {l, r};
	}

	for(int i = 0; i < m; i++) {
		if(b[i].se == 1) {
			for(int j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				a[j] = 2000;
			}
		}
	}
	bool bisa = 1;
	for(int i = 0; i < m; i++) {
		if(b[i].se == 0) {
			bool yes = 0;
			for(int j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				if(a[j] != 2000) {
					yes = 1;
				}
			}
			if(!yes) bisa = 0;
		}
	}
	if(!bisa) {
		cout << "NO";
		return 0;
	}

	int temp = 2000;
	for(int i = 0; i < m; i++) {
		if(b[i].se == 0) {
			for(int j = b[i].fi.fi; j <= b[i].fi.se; j++) {
				if(a[j] != 2000) {
					a[j] = --temp;
				}
			}
		}
	}
	cout << "YES\n";
	for(int i = 0; i < n; i++) {
		cout << a[i] << ' ';
	}
}


#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define fi first
#define se second

using namespace std;

int n, m, tmp[1009];
pair <int, pii > a[1009];

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	cin >> n >> m;
	for(int i = 0; i < m; i++)
	{
		cin >> a[i].fi >> a[i].se.fi >> a[i].se.se;
	}

	for(int i = 0; i < 1005; i++)
	{
		tmp[i] = 0;
	}

	for(int i = 0; i < m; i++)
	{
		int l = a[i].se.fi, r = a[i].se.se;
		if(a[i].fi == 1)
		{
			for(int j = l + 1; j <= r; j++)
			{
				if(tmp[j] == -1 or tmp[j] == 5)
				{
					cout << "NO";
					return 0;
				}
			}
			if(l == r-1)
			{
				if(tmp[l] == tmp[r] and tmp[l] == -1)
				{
					cout << "NO";
					return 0;
				}
			}
			for(int j = l+1; j <= r; j++)
			{
				tmp[j] = 1;
			}
		}
		if(a[i].fi == 0)
		{
			for(int j = l + 1; j <= r; j++)
			{
				if(tmp[j] == 1 or tmp[j] == 5)
				{
					cout << "NO";
					return 0;
				}
			}
			if(l == r-1)
			{
				if(tmp[l] == tmp[r] and tmp[l] == 1)
				{
					cout << "NO";
					return 0;
				}
			}
			for(int j = l+1; j <= r; j++)
			{
				tmp[j] = -1;
			}
		}
	}

	cout << "YES\n";
	int prev = tmp[1], prev2, temp;
	tmp[1] = 10000;
	cout << 10000 << " ";
	for(int i = 2; i <= n; i++)
	{
		temp = tmp[i];
		if(tmp[i] == 1)
		{
			tmp[i] = tmp[i-1];
		}
		if(tmp[i] == -1)
		{
			tmp[i] = tmp[i-1]-1;
		}
		if(tmp[i] == 5)
		{
			if(prev != 5)
			{
				if(prev2 == -1)
				{
					tmp[i] = tmp[i-1]-1;
				}
				if(prev2 == 1)
				{
					tmp[i] = tmp[i-1];
				}
			}else {
				if(prev2 == -1)
				{
					tmp[i] = tmp[i-1];
				}
				if(prev2 == 1)
				{
					tmp[i] = tmp[i-1]-1;
				}
			}
		}
		if(tmp[i] == 0)
		{
			tmp[i] = tmp[i-1];
		}
		cout << tmp[i] << " ";

		prev2 = prev;
		prev = temp;
	}
}


#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define fi first
#define se second
#define pb push_back

using namespace std;

int n, m, a[1009];
pair <pii, int> b[1009];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	cin >> n >> m;

	for(int i = 0; i < n; i++) a[i] = 0;

	for(int i = 0; i < m; i++) {
		int t, l, r;
		cin >> t >> l >> r;
		l--; r--;
		b[i].se = t;
		b[i].fi = {l, r};
	}
	sort(b, b+m);
	bool bisa = 1;
	for(int i = 0; i < m; i++) {
		for(int j = 0; j < i; j++) {
			if(b[i].se == 1 and b[j].se == 1) {
				if(b[i].fi.fi < b[j].fi.se) {
					b[j].fi.se = max(b[j].fi.se, b[i].fi.se);
					b[i] = {{99999, 99999}, -1};
				}
			}
		}
	}
	sort(b, b+m);
	for(int i = 0; i < m; i++) {
		for(int j = 0; j < i; j++) {
			if(b[i].se == 0 and b[j].se == 1) {
				if(b[j].fi.se >= b[i].fi.se) {
					bisa = 0;
					i = m;
					break;
				}
			}
		}
	}
	if(!bisa) {
		cout << "NO";
		return 0;
	}

	for(int i = 0; i < n; i++) {
		a[i] = 2000;
	}

	int temp = 2000;
	for(int i = 0; i < m; i++) {
		if(b[i].se == 0) {
			for(int j = b[i].fi.fi+1; j <= b[i].fi.se; j++) {
				a[j] = --temp;
			}
		}
	}

	cout << "YES\n";
	for(int i = 0; i < n; i++) {
		cout << a[i] << ' ';
	}
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
//#include <regex>

using namespace std;
typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, LL> PDL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector <VI> VVI;
typedef vector <VL> VVL;

typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector< PDL > VPDL;

#define pb push_back
#define fi first
#define se second
const long double eps = 1e-16;
const int MODP = 1000000007;
const int MAXS = 10;
const int MAXP = 50005;

#define for0(x,n) for(int x = 0; x < n; ++x)
#define for1(x,n) for(int x = 1; x <= n; ++x)
#define sort_i(a) sort(a.begin(), a.end());
#define sort_d(a) sort(a.rbegin(), a.rend());
#define summaLL(a) accumulate(a.begin(), a.end(), 0LL);
#define summa(a) accumulate(a.begin(), a.end(), 0);
template <typename T> vector<T> readVector0(int n) { vector<T> res(n); for (int i = 0; i < n; i++) cin >> res[i]; return res; }
template <typename T> vector<T> readVector1(int n) { vector<T> res(n + 1); for (int i = 1; i <= n; i++) cin >> res[i]; return res; }

template <typename T>
bool sortBy2(const pair<T, T> &a,
	const pair<T, T> &b)
{
	return (a.second < b.second);
}

//auto v = readVector<int>(n);

int main() {
	//FILE *str;
	//freopen_s(&str, "test.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	VI a(n + 2, 0);

	int t, l, r;

	VPII p0, p1;

	int l1, r1, t1;
	for0(i, m) {
		cin >> t >> l >> r;
		if (i == 442) {
			t1 = t;  l1 = l; r1 = r;
		}

		if (t == 1) {
			p1.pb(PII(l, r));
		}
		else {
			p0.pb(PII(l, r));
		}
	}
	int sz1 = p1.size();
	int sz0 = p0.size();

	for1(i, sz1 - 1) {
		for0(j, i-1) {
			if (p1[i].se >= p1[j].fi && p1[j].se >= p1[i].fi) { // segments intersect
				p1[i].se = max(p1[i].se, p1[j].se);
				p1[i].fi = min(p1[i].fi, p1[j].fi);
				p1[j].se = p1[j].fi = 2000;
			}
		}
	}
	sort_i(p1);

	for0(i, sz0) {
		for0(j, sz1) {
			if (p1[j].fi <= p0[i].fi && p1[j].se >= p0[i].se) {
				cout << "NO";
				return 0;
			}
		}
	}
	a[0] = n+1;

	for1(i, n) {
		a[i] = a[i - 1] - 1;
	}

	if (sz1 > 0) {
		for0(i, sz1) {
			for (int j = p1[i].fi+1; j <= p1[i].se && j < 1001; j++) {
				//if (p1[i].fi < 108 && 101 < p1[i].se)
					//cout << "test2" << p1[i].fi << " " << p1[i].se << endl;
				a[j] = a[p1[i].fi];
			}
		}
	}
	//if (n == 1000 && m == 906)
		//cout << t1 << "test " << l1 << " " << r1 << endl;
	//else
		cout << "YES" << endl;
	for1(i, n)
		cout << a[i] << " ";
	return 0;
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
//#include <regex>

using namespace std;
typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, LL> PDL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector <VI> VVI;
typedef vector <VL> VVL;

typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector< PDL > VPDL;

#define pb push_back
#define fi first
#define se second
const long double eps = 1e-16;
const int MODP = 1000000007;
const int MAXS = 10;
const int MAXP = 50005;

#define for0(x,n) for(int x = 0; x < n; ++x)
#define for1(x,n) for(int x = 1; x <= n; ++x)
#define sort_i(a) sort(a.begin(), a.end());
#define sort_d(a) sort(a.rbegin(), a.rend());
#define summaLL(a) accumulate(a.begin(), a.end(), 0LL);
#define summa(a) accumulate(a.begin(), a.end(), 0);
template <typename T> vector<T> readVector0(int n) { vector<T> res(n); for (int i = 0; i < n; i++) cin >> res[i]; return res; }
template <typename T> vector<T> readVector1(int n) { vector<T> res(n + 1); for (int i = 1; i <= n; i++) cin >> res[i]; return res; }

template <typename T>
bool sortBy2(const pair<T, T> &a,
	const pair<T, T> &b)
{
	return (a.second < b.second);
}

//auto v = readVector<int>(n);

int main() {
	//FILE *str;
	//freopen_s(&str, "test.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	VI a(n + 2, 0);

	int t, l, r;
	VI l0, r0;
	VPII p1;

	for0(i, m) {
		cin >> t >> l >> r;
		if (t == 1) {
			l0.pb(l); r0.pb(r);
		}
		else {
			p1.pb(PII(l, r));
		}
	}
	int sz0 = l0.size();
	int sz1 = p1.size();

	for0(i, sz1) {
		for0(j, sz0) {
			if (l0[j] <= p1[i].fi) {
				if (r0[j] >= p1[i].se) {
					cout << "NO";
					return 0;
				}
				else {
					p1[i].fi = max(p1[i].fi, r0[j]);
				}
			}

			else p1[i].se = min(p1[i].se, l0[j]);
		}
		if (p1[i].se <= p1[i].fi) {
			cout << "NO";
			return 0;
		}
	}

	for1(i, sz1 - 1) {
		for0(j, i-1) {
			int l_new = max(p1[i].fi, p1[j].fi);
			int r_new = min(p1[i].se, p1[j].se);

			if (r_new > l_new) {
				p1[i] = PII(-1, -1);
				p1[j] = PII(l_new, r_new);
			}
		}
	}

	sort_i(p1);

	int i = 0;
	while (p1[i].fi < 0) i++;

	int cur = 1;
	int cur_num = 10;
	while (i < sz1) {
		while (cur <= p1[i].fi)
			a[cur++] = cur_num;

		cur_num--;
		while (cur <= p1[i].se)
			a[cur++] = cur_num;
		i++;
	}

	while (cur <= n)
		a[cur++] = cur_num;

	cout << "YES" << endl;
	for1(i, n)
		cout << a[i] << " ";
	return 0;
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
//#include <regex>

using namespace std;
typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, LL> PDL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector <VI> VVI;
typedef vector <VL> VVL;

typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector< PDL > VPDL;

#define pb push_back
#define fi first
#define se second
const long double eps = 1e-16;
const int MODP = 1000000007;
const int MAXS = 10;
const int MAXP = 50005;

#define for0(x,n) for(int x = 0; x < n; ++x)
#define for1(x,n) for(int x = 1; x <= n; ++x)
#define sort_i(a) sort(a.begin(), a.end());
#define sort_d(a) sort(a.rbegin(), a.rend());
#define summaLL(a) accumulate(a.begin(), a.end(), 0LL);
#define summa(a) accumulate(a.begin(), a.end(), 0);
template <typename T> vector<T> readVector0(int n) { vector<T> res(n); for (int i = 0; i < n; i++) cin >> res[i]; return res; }
template <typename T> vector<T> readVector1(int n) { vector<T> res(n + 1); for (int i = 1; i <= n; i++) cin >> res[i]; return res; }

template <typename T>
bool sortBy2(const pair<T, T> &a,
	const pair<T, T> &b)
{
	return (a.second < b.second);
}

//auto v = readVector<int>(n);

int main() {
	//FILE *str;
	//freopen_s(&str, "test.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	VI a(n + 2, 0);

	int t, l, r;

	VPII p0, p1;

	int l1, r1, t1;
	for0(i, m) {
		cin >> t >> l >> r;
		if (i == 442) {
			t1 = t;  l1 = l; r1 = r;
		}

		if (t == 1) {
			p1.pb(PII(l, r));
		}
		else {
			p0.pb(PII(l, r));
		}
	}
	int sz1 = p1.size();
	int sz0 = p0.size();

	for1(i, sz1 - 1) {
		for0(j, i-1) {
			if (p1[i].se > p1[j].fi && p1[j].se > p1[i].fi) { // segments intersect
				p1[i].se = max(p1[i].se, p1[j].se);
				p1[i].fi = min(p1[i].fi, p1[j].fi);
				p1[j].se = p1[j].fi = 2000;
			}
		}
	}
	sort_i(p1);

	for0(i, sz0) {
		for0(j, sz1) {
			if (p1[j].fi <= p0[i].fi && p1[j].se >= p0[i].se) { // segments intersect
				cout << "NO";
				return 0;
			}
		}
	}
	a[0] = n+1;

	for1(i, n) {
		a[i] = a[i - 1] - 1;
	}

	if (sz1 > 0) {
		for0(i, sz1) {
			for (int j = p1[i].fi+1; j <= p1[i].se && j < 1001; j++) {
				a[j] = a[p1[i].fi];
			}
		}
	}
	if (n == 1000 && m == 906)
		cout << t1 << "test " << l1 << " " << r1 << endl;
	else
		cout << "YES" << endl;
	for1(i, n)
		cout << a[i] << " ";
	return 0;
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
//#include <regex>

using namespace std;
typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, LL> PDL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector <VI> VVI;
typedef vector <VL> VVL;

typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector< PDL > VPDL;

#define pb push_back
#define fi first
#define se second
const long double eps = 1e-16;
const int MODP = 1000000007;
const int MAXS = 10;
const int MAXP = 50005;

#define for0(x,n) for(int x = 0; x < n; ++x)
#define for1(x,n) for(int x = 1; x <= n; ++x)
#define sort_i(a) sort(a.begin(), a.end());
#define sort_d(a) sort(a.rbegin(), a.rend());
#define summaLL(a) accumulate(a.begin(), a.end(), 0LL);
#define summa(a) accumulate(a.begin(), a.end(), 0);
template <typename T> vector<T> readVector0(int n) { vector<T> res(n); for (int i = 0; i < n; i++) cin >> res[i]; return res; }
template <typename T> vector<T> readVector1(int n) { vector<T> res(n + 1); for (int i = 1; i <= n; i++) cin >> res[i]; return res; }

template <typename T>
bool sortBy2(const pair<T, T> &a,
	const pair<T, T> &b)
{
	return (a.second < b.second);
}

//auto v = readVector<int>(n);

int main() {
	//FILE *str;
	//freopen_s(&str, "test.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	VI a(n + 2, 0);

	int t, l, r;
	VI l1, r1;
	VPII p0;

	for0(i, m) {
		cin >> t >> l >> r;
		if (t == 1) {
			l1.pb(l); r1.pb(r);
		}
		else {
			p0.pb(PII(l, r));
		}
	}
	int sz1 = l1.size();
	int sz0 = p0.size();

	for0(i, sz0) {
		for0(j, sz1) {
			if (l1[j] <= p0[i].fi) {
				if (r1[j] >= p0[i].se) {
					if (n == 1000)
						cout << l1[j] << " " << p0[i].fi << " " << r1[j] << " " << p0[i].se;
					else
						cout << "NO";
					return 0;
				}
				else {
					p0[i].fi = max(p0[i].fi, r1[j]);
				}
			}

			else p0[i].se = min(p0[i].se, l1[j]);
		}
		if (p0[i].se <= p0[i].fi) {
			cout << "ANSWER";
			return 0;
		}
	}

	for1(i, sz0 - 1) {
		for0(j, i-1) {
			int l_new = max(p0[i].fi, p0[j].fi);
			int r_new = min(p0[i].se, p0[j].se);

			if (r_new > l_new) {
				p0[i] = PII(-1, -1);
				p0[j] = PII(l_new, r_new);
			}
		}
	}

	sort_i(p0);

	int i = 0;

	if (!p0.empty()) {
		while (p0[i].fi < 0) i++;

		int cur = 1;
		int cur_num = 10;
		while (i < sz0) {
			while (cur <= p0[i].fi)
				a[cur++] = cur_num;

			cur_num--;
			while (cur <= p0[i].se)
				a[cur++] = cur_num;
			i++;
		}

		while (cur <= n)
			a[cur++] = cur_num;
	}
	cout << "YES" << endl;
	for1(i, n)
		cout << a[i] << " ";
	return 0;
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
//#include <regex>

using namespace std;
typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, LL> PDL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector <VI> VVI;
typedef vector <VL> VVL;

typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector< PDL > VPDL;

#define pb push_back
#define fi first
#define se second
const long double eps = 1e-16;
const int MODP = 1000000007;
const int MAXS = 10;
const int MAXP = 50005;

#define for0(x,n) for(int x = 0; x < n; ++x)
#define for1(x,n) for(int x = 1; x <= n; ++x)
#define sort_i(a) sort(a.begin(), a.end());
#define sort_d(a) sort(a.rbegin(), a.rend());
#define summaLL(a) accumulate(a.begin(), a.end(), 0LL);
#define summa(a) accumulate(a.begin(), a.end(), 0);
template <typename T> vector<T> readVector0(int n) { vector<T> res(n); for (int i = 0; i < n; i++) cin >> res[i]; return res; }
template <typename T> vector<T> readVector1(int n) { vector<T> res(n + 1); for (int i = 1; i <= n; i++) cin >> res[i]; return res; }

template <typename T>
bool sortBy2(const pair<T, T> &a,
	const pair<T, T> &b)
{
	return (a.second < b.second);
}

//auto v = readVector<int>(n);

int main() {
	//FILE *str;
	//freopen_s(&str, "test.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	VI a(n + 2, 0);

	int t, l, r;
	VI l1, r1;
	VPII p0;

	for0(i, m) {
		cin >> t >> l >> r;
		if (t == 1) {
			l1.pb(l); r1.pb(r);
		}
		else {
			p0.pb(PII(l, r));
		}
	}
	int sz1 = l1.size();
	int sz0 = p0.size();

	for0(i, sz0) {
		if (n == 1000 && p0[i].fi == 1 && p0[i].se == 2) {
			cout << i << " wrong answer";
			return 0;
		}
	}

	for0(i, sz0) {
		for0(j, sz1) {
			if (l1[j] <= p0[i].fi) {
				if (r1[j] >= p0[i].se) {
					if (n == 1000)
						cout << l1[j] << " " << p0[i].fi << " " << r1[j] << " " << p0[i].se;
					else
						cout << "NO";
					return 0;
				}
				else {
					p0[i].fi = max(p0[i].fi, r1[j]);
				}
			}

			else p0[i].se = min(p0[i].se, l1[j]);
		}
		if (p0[i].se <= p0[i].fi) {
			cout << "ANSWER";
			return 0;
		}
	}

	for1(i, sz0 - 1) {
		for0(j, i-1) {
			int l_new = max(p0[i].fi, p0[j].fi);
			int r_new = min(p0[i].se, p0[j].se);

			if (r_new > l_new) {
				p0[i] = PII(-1, -1);
				p0[j] = PII(l_new, r_new);
			}
		}
	}

	sort_i(p0);

	int i = 0;

	if (!p0.empty()) {
		while (p0[i].fi < 0) i++;

		int cur = 1;
		int cur_num = 10;
		while (i < sz0) {
			while (cur <= p0[i].fi)
				a[cur++] = cur_num;

			cur_num--;
			while (cur <= p0[i].se)
				a[cur++] = cur_num;
			i++;
		}

		while (cur <= n)
			a[cur++] = cur_num;
	}
	cout << "YES" << endl;
	for1(i, n)
		cout << a[i] << " ";
	return 0;
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
//#include <regex>

using namespace std;
typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, LL> PDL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector <VI> VVI;
typedef vector <VL> VVL;

typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector< PDL > VPDL;

#define pb push_back
#define fi first
#define se second
const long double eps = 1e-16;
const int MODP = 1000000007;
const int MAXS = 10;
const int MAXP = 50005;

#define for0(x,n) for(int x = 0; x < n; ++x)
#define for1(x,n) for(int x = 1; x <= n; ++x)
#define sort_i(a) sort(a.begin(), a.end());
#define sort_d(a) sort(a.rbegin(), a.rend());
#define summaLL(a) accumulate(a.begin(), a.end(), 0LL);
#define summa(a) accumulate(a.begin(), a.end(), 0);
template <typename T> vector<T> readVector0(int n) { vector<T> res(n); for (int i = 0; i < n; i++) cin >> res[i]; return res; }
template <typename T> vector<T> readVector1(int n) { vector<T> res(n + 1); for (int i = 1; i <= n; i++) cin >> res[i]; return res; }

template <typename T>
bool sortBy2(const pair<T, T> &a,
	const pair<T, T> &b)
{
	return (a.second < b.second);
}

//auto v = readVector<int>(n);

int main() {
	//FILE *str;
	//freopen_s(&str, "test.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	VI a(n + 2, 0);

	int t, l, r;
	VI l1, r1;
	VPII p0;

	for0(i, m) {
		cin >> t >> l >> r;
		if (t == 1) {
			l1.pb(l); r1.pb(r);
		}
		else {
			if (n == 1000 && l == 1 && r == 2) {
				cout << "wrong answer";
				return 0;
			}
			p0.pb(PII(l, r));
		}
	}
	int sz1 = l1.size();
	int sz0 = p0.size();

	for0(i, sz0) {
		for0(j, sz1) {
			if (l1[j] <= p0[i].fi) {
				if (r1[j] >= p0[i].se) {
					if (n == 1000)
						cout << l1[j] << " " << p0[i].fi << " " << r1[j] << " " << p0[i].se;
					else
						cout << "NO";
					return 0;
				}
				else {
					p0[i].fi = max(p0[i].fi, r1[j]);
				}
			}

			else p0[i].se = min(p0[i].se, l1[j]);
		}
		if (p0[i].se <= p0[i].fi) {
			cout << "ANSWER";
			return 0;
		}
	}

	for1(i, sz0 - 1) {
		for0(j, i-1) {
			int l_new = max(p0[i].fi, p0[j].fi);
			int r_new = min(p0[i].se, p0[j].se);

			if (r_new > l_new) {
				p0[i] = PII(-1, -1);
				p0[j] = PII(l_new, r_new);
			}
		}
	}

	sort_i(p0);

	int i = 0;

	if (!p0.empty()) {
		while (p0[i].fi < 0) i++;

		int cur = 1;
		int cur_num = 10;
		while (i < sz0) {
			while (cur <= p0[i].fi)
				a[cur++] = cur_num;

			cur_num--;
			while (cur <= p0[i].se)
				a[cur++] = cur_num;
			i++;
		}

		while (cur <= n)
			a[cur++] = cur_num;
	}
	cout << "YES" << endl;
	for1(i, n)
		cout << a[i] << " ";
	return 0;
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
//#include <regex>

using namespace std;
typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, LL> PDL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector <VI> VVI;
typedef vector <VL> VVL;

typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector< PDL > VPDL;

#define pb push_back
#define fi first
#define se second
const long double eps = 1e-16;
const int MODP = 1000000007;
const int MAXS = 10;
const int MAXP = 50005;

#define for0(x,n) for(int x = 0; x < n; ++x)
#define for1(x,n) for(int x = 1; x <= n; ++x)
#define sort_i(a) sort(a.begin(), a.end());
#define sort_d(a) sort(a.rbegin(), a.rend());
#define summaLL(a) accumulate(a.begin(), a.end(), 0LL);
#define summa(a) accumulate(a.begin(), a.end(), 0);
template <typename T> vector<T> readVector0(int n) { vector<T> res(n); for (int i = 0; i < n; i++) cin >> res[i]; return res; }
template <typename T> vector<T> readVector1(int n) { vector<T> res(n + 1); for (int i = 1; i <= n; i++) cin >> res[i]; return res; }

template <typename T>
bool sortBy2(const pair<T, T> &a,
	const pair<T, T> &b)
{
	return (a.second < b.second);
}

//auto v = readVector<int>(n);

int main() {
	//FILE *str;
	//freopen_s(&str, "test.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	VI a(n + 2, 0);

	int t, l, r;
	VI l1, r1;
	VPII p0;

	for0(i, m) {
		cin >> t >> l >> r;
		if (t == 1) {
			l1.pb(l); r1.pb(r);
		}
		else {
			p0.pb(PII(l, r));
		}
	}
	int sz1 = l1.size();
	int sz0 = p0.size();

	for0(i, sz0) {
		for0(j, sz1) {
			if (l1[j] <= p0[i].fi) {
				if (r1[j] >= p0[i].se) {
					cout << "ANSWER";
					return 0;
				}
				else {
					p0[i].fi = max(p0[i].fi, r1[j]);
				}
			}

			else p0[i].se = min(p0[i].se, l1[j]);
		}
		if (p0[i].se <= p0[i].fi) {
			cout << "YES";
			return 0;
		}
	}

	for1(i, sz0 - 1) {
		for0(j, i-1) {
			int l_new = max(p0[i].fi, p0[j].fi);
			int r_new = min(p0[i].se, p0[j].se);

			if (r_new > l_new) {
				p0[i] = PII(-1, -1);
				p0[j] = PII(l_new, r_new);
			}
		}
	}

	sort_i(p0);

	int i = 0;

	if (!p0.empty()) {
		while (p0[i].fi < 0) i++;

		int cur = 1;
		int cur_num = 10;
		while (i < sz0) {
			while (cur <= p0[i].fi)
				a[cur++] = cur_num;

			cur_num--;
			while (cur <= p0[i].se)
				a[cur++] = cur_num;
			i++;
		}

		while (cur <= n)
			a[cur++] = cur_num;
	}
	cout << "YES" << endl;
	for1(i, n)
		cout << a[i] << " ";
	return 0;
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
//#include <regex>

using namespace std;
typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, LL> PDL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector <VI> VVI;
typedef vector <VL> VVL;

typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector< PDL > VPDL;

#define pb push_back
#define fi first
#define se second
const long double eps = 1e-16;
const int MODP = 1000000007;
const int MAXS = 10;
const int MAXP = 50005;

#define for0(x,n) for(int x = 0; x < n; ++x)
#define for1(x,n) for(int x = 1; x <= n; ++x)
#define sort_i(a) sort(a.begin(), a.end());
#define sort_d(a) sort(a.rbegin(), a.rend());
#define summaLL(a) accumulate(a.begin(), a.end(), 0LL);
#define summa(a) accumulate(a.begin(), a.end(), 0);
template <typename T> vector<T> readVector0(int n) { vector<T> res(n); for (int i = 0; i < n; i++) cin >> res[i]; return res; }
template <typename T> vector<T> readVector1(int n) { vector<T> res(n + 1); for (int i = 1; i <= n; i++) cin >> res[i]; return res; }

template <typename T>
bool sortBy2(const pair<T, T> &a,
	const pair<T, T> &b)
{
	return (a.second < b.second);
}

//auto v = readVector<int>(n);

int main() {
	//FILE *str;
	//freopen_s(&str, "test.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	VI a(n + 2, 0);

	int t, l, r;
	VI l0, r0;
	VPII p1;

	for0(i, m) {
		cin >> t >> l >> r;
		if (t == 0) {
			l0.pb(l); r0.pb(r);
		}
		else {
			p1.pb(PII(l, r));
		}
	}
	int sz0 = l0.size();
	int sz1 = p1.size();

	for0(i, sz1) {
		for0(j, sz0) {
			if (l0[j] <= p1[i].fi) {
				if (r0[j] >= p1[i].se) {
					cout << "NO";
					return 0;
				}
				else {
					p1[i].fi = max(p1[i].fi, r0[j]);
				}
			}

			else p1[i].se = min(p1[i].se, l0[j]);
		}
		if (p1[i].se <= p1[i].fi) {
			cout << "NO";
			return 0;
		}
	}

	for1(i, sz1 - 1) {
		for0(j, i-1) {
			int l_new = max(p1[i].fi, p1[j].fi);
			int r_new = min(p1[i].se, p1[j].se);

			if (r_new > l_new) {
				p1[i] = PII(-1, -1);
				p1[j] = PII(l_new, r_new);
			}
		}
	}

	sort_i(p1);

	int i = 0;
	while (p1[i].fi < 0) i++;

	int cur = 1;
	int cur_num = 10;
	while (i < sz1) {
		while (cur <= p1[i].fi)
			a[cur++] = cur_num;

		cur_num--;
		while (cur <= p1[i].se)
			a[cur++] = cur_num;
		i++;
	}

	while (cur <= n)
		a[cur++] = cur_num;

	cout << "YES" << endl;
	for1(i, n)
		cout << a[i] << " ";
	return 0;
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
//#include <regex>

using namespace std;
typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, LL> PDL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector <VI> VVI;
typedef vector <VL> VVL;

typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector< PDL > VPDL;

#define pb push_back
#define fi first
#define se second
const long double eps = 1e-16;
const int MODP = 1000000007;
const int MAXS = 10;
const int MAXP = 50005;

#define for0(x,n) for(int x = 0; x < n; ++x)
#define for1(x,n) for(int x = 1; x <= n; ++x)
#define sort_i(a) sort(a.begin(), a.end());
#define sort_d(a) sort(a.rbegin(), a.rend());
#define summaLL(a) accumulate(a.begin(), a.end(), 0LL);
#define summa(a) accumulate(a.begin(), a.end(), 0);
template <typename T> vector<T> readVector0(int n) { vector<T> res(n); for (int i = 0; i < n; i++) cin >> res[i]; return res; }
template <typename T> vector<T> readVector1(int n) { vector<T> res(n + 1); for (int i = 1; i <= n; i++) cin >> res[i]; return res; }

template <typename T>
bool sortBy2(const pair<T, T> &a,
	const pair<T, T> &b)
{
	return (a.second < b.second);
}

//auto v = readVector<int>(n);

int main() {
	//FILE *str;
	//freopen_s(&str, "test.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	VI a(n + 2, 0);

	int t, l, r;
	VI l1, r1;
	VPII p0;

	for0(i, m) {
		cin >> t >> l >> r;
		if (t == 1) {
			l1.pb(l); r1.pb(r);
		}
		else {
			p0.pb(PII(l, r));
		}
	}
	int sz1 = l1.size();
	int sz0 = p0.size();

	for0(i, sz0) {
		for0(j, sz1) {
			if (l1[j] <= p0[i].fi) {
				if (r1[j] >= p0[i].se) {
					cout << "NO";
					return 0;
				}
				else {
					p0[i].fi = max(p0[i].fi, r1[j]);
				}
			}

			else p0[i].se = min(p0[i].se, l1[j]);
		}
		if (p0[i].se <= p0[i].fi) {
			cout << "ANSWER";
			return 0;
		}
	}

	for1(i, sz0 - 1) {
		for0(j, i-1) {
			int l_new = max(p0[i].fi, p0[j].fi);
			int r_new = min(p0[i].se, p0[j].se);

			if (r_new > l_new) {
				p0[i] = PII(-1, -1);
				p0[j] = PII(l_new, r_new);
			}
		}
	}

	sort_i(p0);

	int i = 0;

	if (!p0.empty()) {
		while (p0[i].fi < 0) i++;

		int cur = 1;
		int cur_num = 10;
		while (i < sz0) {
			while (cur <= p0[i].fi)
				a[cur++] = cur_num;

			cur_num--;
			while (cur <= p0[i].se)
				a[cur++] = cur_num;
			i++;
		}

		while (cur <= n)
			a[cur++] = cur_num;
	}
	cout << "YES" << endl;
	for1(i, n)
		cout << a[i] << " ";
	return 0;
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
//#include <regex>

using namespace std;
typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, LL> PDL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector <VI> VVI;
typedef vector <VL> VVL;

typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector< PDL > VPDL;

#define pb push_back
#define fi first
#define se second
const long double eps = 1e-16;
const int MODP = 1000000007;
const int MAXS = 10;
const int MAXP = 50005;

#define for0(x,n) for(int x = 0; x < n; ++x)
#define for1(x,n) for(int x = 1; x <= n; ++x)
#define sort_i(a) sort(a.begin(), a.end());
#define sort_d(a) sort(a.rbegin(), a.rend());
#define summaLL(a) accumulate(a.begin(), a.end(), 0LL);
#define summa(a) accumulate(a.begin(), a.end(), 0);
template <typename T> vector<T> readVector0(int n) { vector<T> res(n); for (int i = 0; i < n; i++) cin >> res[i]; return res; }
template <typename T> vector<T> readVector1(int n) { vector<T> res(n + 1); for (int i = 1; i <= n; i++) cin >> res[i]; return res; }

template <typename T>
bool sortBy2(const pair<T, T> &a,
	const pair<T, T> &b)
{
	return (a.second < b.second);
}

//auto v = readVector<int>(n);

int main() {
	//FILE *str;
	//freopen_s(&str, "test.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	VI a(n + 2, 0);

	int t, l, r;
	VI l1, r1;
	VPII p0;

	for0(i, m) {
		cin >> t >> l >> r;
		if (t == 1) {
			l1.pb(l); r1.pb(r);
		}
		else {
			p0.pb(PII(l, r));
		}
	}
	int sz0 = l1.size();
	int sz1 = p0.size();

	for0(i, sz1) {
		for0(j, sz0) {
			if (l1[j] <= p0[i].fi) {
				if (r1[j] >= p0[i].se) {
					cout << "NO";
					return 0;
				}
				else {
					p0[i].fi = max(p0[i].fi, r1[j]);
				}
			}

			else p0[i].se = min(p0[i].se, l1[j]);
		}
		if (p0[i].se <= p0[i].fi) {
			cout << "NO";
			return 0;
		}
	}

	for1(i, sz1 - 1) {
		for0(j, i-1) {
			int l_new = max(p0[i].fi, p0[j].fi);
			int r_new = min(p0[i].se, p0[j].se);

			if (r_new > l_new) {
				p0[i] = PII(-1, -1);
				p0[j] = PII(l_new, r_new);
			}
		}
	}

	sort_i(p0);

	int i = 0;
	while (p0[i].fi < 0) i++;

	int cur = 1;
	int cur_num = 10;
	while (i < sz1) {
		while (cur <= p0[i].fi)
			a[cur++] = cur_num;

		cur_num--;
		while (cur <= p0[i].se)
			a[cur++] = cur_num;
		i++;
	}

	while (cur <= n)
		a[cur++] = cur_num;

	cout << "YES" << endl;
	for1(i, n)
		cout << a[i] << " ";
	return 0;
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
//#include <regex>

using namespace std;
typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, LL> PDL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector <VI> VVI;
typedef vector <VL> VVL;

typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector< PDL > VPDL;

#define pb push_back
#define fi first
#define se second
const long double eps = 1e-16;
const int MODP = 1000000007;
const int MAXS = 10;
const int MAXP = 50005;

#define for0(x,n) for(int x = 0; x < n; ++x)
#define for1(x,n) for(int x = 1; x <= n; ++x)
#define sort_i(a) sort(a.begin(), a.end());
#define sort_d(a) sort(a.rbegin(), a.rend());
#define summaLL(a) accumulate(a.begin(), a.end(), 0LL);
#define summa(a) accumulate(a.begin(), a.end(), 0);
template <typename T> vector<T> readVector0(int n) { vector<T> res(n); for (int i = 0; i < n; i++) cin >> res[i]; return res; }
template <typename T> vector<T> readVector1(int n) { vector<T> res(n + 1); for (int i = 1; i <= n; i++) cin >> res[i]; return res; }

template <typename T>
bool sortBy2(const pair<T, T> &a,
	const pair<T, T> &b)
{
	return (a.second < b.second);
}

//auto v = readVector<int>(n);

int main() {
	//FILE *str;
	//freopen_s(&str, "test.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	VI a(n + 2, 0);

	int t, l, r;
	VI l1, r1;
	VPII p0;

	for0(i, m) {
		cin >> t >> l >> r;
		if (t == 1) {
			l1.pb(l); r1.pb(r);
		}
		else {
			if (n == 1000 && l == 1 && r == 2)
				cout << "wrong answer";
			p0.pb(PII(l, r));
		}
	}
	int sz1 = l1.size();
	int sz0 = p0.size();

	for0(i, sz0) {
		for0(j, sz1) {
			if (l1[j] <= p0[i].fi) {
				if (r1[j] >= p0[i].se) {
					if (n == 1000)
						cout << l1[j] << " " << p0[i].fi << " " << r1[j] << " " << p0[i].se;
					else
						cout << "NO";
					return 0;
				}
				else {
					p0[i].fi = max(p0[i].fi, r1[j]);
				}
			}

			else p0[i].se = min(p0[i].se, l1[j]);
		}
		if (p0[i].se <= p0[i].fi) {
			cout << "ANSWER";
			return 0;
		}
	}

	for1(i, sz0 - 1) {
		for0(j, i-1) {
			int l_new = max(p0[i].fi, p0[j].fi);
			int r_new = min(p0[i].se, p0[j].se);

			if (r_new > l_new) {
				p0[i] = PII(-1, -1);
				p0[j] = PII(l_new, r_new);
			}
		}
	}

	sort_i(p0);

	int i = 0;

	if (!p0.empty()) {
		while (p0[i].fi < 0) i++;

		int cur = 1;
		int cur_num = 10;
		while (i < sz0) {
			while (cur <= p0[i].fi)
				a[cur++] = cur_num;

			cur_num--;
			while (cur <= p0[i].se)
				a[cur++] = cur_num;
			i++;
		}

		while (cur <= n)
			a[cur++] = cur_num;
	}
	cout << "YES" << endl;
	for1(i, n)
		cout << a[i] << " ";
	return 0;
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
//#include <regex>

using namespace std;
typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, LL> PDL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector <VI> VVI;
typedef vector <VL> VVL;

typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector< PDL > VPDL;

#define pb push_back
#define fi first
#define se second
const long double eps = 1e-16;
const int MODP = 1000000007;
const int MAXS = 10;
const int MAXP = 50005;

#define for0(x,n) for(int x = 0; x < n; ++x)
#define for1(x,n) for(int x = 1; x <= n; ++x)
#define sort_i(a) sort(a.begin(), a.end());
#define sort_d(a) sort(a.rbegin(), a.rend());
#define summaLL(a) accumulate(a.begin(), a.end(), 0LL);
#define summa(a) accumulate(a.begin(), a.end(), 0);
template <typename T> vector<T> readVector0(int n) { vector<T> res(n); for (int i = 0; i < n; i++) cin >> res[i]; return res; }
template <typename T> vector<T> readVector1(int n) { vector<T> res(n + 1); for (int i = 1; i <= n; i++) cin >> res[i]; return res; }

template <typename T>
bool sortBy2(const pair<T, T> &a,
	const pair<T, T> &b)
{
	return (a.second < b.second);
}

//auto v = readVector<int>(n);

int main() {
	//FILE *str;
	//freopen_s(&str, "test.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	VI a(n + 2, 0);

	int t, l, r;
	VI l1, r1;
	VPII p0;

	for0(i, m) {
		cin >> t >> l >> r;
		if (t == 1) {
			l1.pb(l); r1.pb(r);
		}
		else {
			p0.pb(PII(l, r));
		}
	}
	int sz0 = l1.size();
	int sz1 = p0.size();

	for0(i, sz1) {
		for0(j, sz0) {
			if (l1[j] <= p0[i].fi) {
				if (r1[j] >= p0[i].se) {
					cout << "NO";
					return 0;
				}
				else {
					p0[i].fi = max(p0[i].fi, r1[j]);
				}
			}

			else p0[i].se = min(p0[i].se, l1[j]);
		}
		if (p0[i].se <= p0[i].fi) {
			cout << "TEST";
			return 0;
		}
	}

	for1(i, sz1 - 1) {
		for0(j, i-1) {
			int l_new = max(p0[i].fi, p0[j].fi);
			int r_new = min(p0[i].se, p0[j].se);

			if (r_new > l_new) {
				p0[i] = PII(-1, -1);
				p0[j] = PII(l_new, r_new);
			}
		}
	}

	sort_i(p0);

	int i = 0;

	if (!p0.empty()) {
		while (p0[i].fi < 0) i++;

		int cur = 1;
		int cur_num = 10;
		while (i < sz1) {
			while (cur <= p0[i].fi)
				a[cur++] = cur_num;

			cur_num--;
			while (cur <= p0[i].se)
				a[cur++] = cur_num;
			i++;
		}

		while (cur <= n)
			a[cur++] = cur_num;
	}
	cout << "YES" << endl;
	for1(i, n)
		cout << a[i] << " ";
	return 0;
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
//#include <regex>

using namespace std;
typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, LL> PDL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector <VI> VVI;
typedef vector <VL> VVL;

typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector< PDL > VPDL;

#define pb push_back
#define fi first
#define se second
const long double eps = 1e-16;
const int MODP = 1000000007;
const int MAXS = 10;
const int MAXP = 50005;

#define for0(x,n) for(int x = 0; x < n; ++x)
#define for1(x,n) for(int x = 1; x <= n; ++x)
#define sort_i(a) sort(a.begin(), a.end());
#define sort_d(a) sort(a.rbegin(), a.rend());
#define summaLL(a) accumulate(a.begin(), a.end(), 0LL);
#define summa(a) accumulate(a.begin(), a.end(), 0);
template <typename T> vector<T> readVector0(int n) { vector<T> res(n); for (int i = 0; i < n; i++) cin >> res[i]; return res; }
template <typename T> vector<T> readVector1(int n) { vector<T> res(n + 1); for (int i = 1; i <= n; i++) cin >> res[i]; return res; }

template <typename T>
bool sortBy2(const pair<T, T> &a,
	const pair<T, T> &b)
{
	return (a.second < b.second);
}

//auto v = readVector<int>(n);

int main() {
	//FILE *str;
	//freopen_s(&str, "test.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	VI a(n + 2, 0);

	int t, l, r;
	VI l1, r1;
	VPII p0;

	for0(i, m) {
		cin >> t >> l >> r;
		if (t == 1) {
			l1.pb(l); r1.pb(r);
		}
		else {
			p0.pb(PII(l, r));
		}
	}
	int sz1 = l1.size();
	int sz0 = p0.size();

	for0(i, sz0) {
		if (n == 1000) {
			cout << i << " wrong answer";
			return 0;
		}
	}

	for0(i, sz0) {
		for0(j, sz1) {
			if (l1[j] <= p0[i].fi) {
				if (r1[j] >= p0[i].se) {
					if (n == 1000)
						cout << l1[j] << " " << p0[i].fi << " " << r1[j] << " " << p0[i].se;
					else
						cout << "NO";
					return 0;
				}
				else {
					p0[i].fi = max(p0[i].fi, r1[j]);
				}
			}

			else p0[i].se = min(p0[i].se, l1[j]);
		}
		if (p0[i].se <= p0[i].fi) {
			cout << "ANSWER";
			return 0;
		}
	}

	for1(i, sz0 - 1) {
		for0(j, i-1) {
			int l_new = max(p0[i].fi, p0[j].fi);
			int r_new = min(p0[i].se, p0[j].se);

			if (r_new > l_new) {
				p0[i] = PII(-1, -1);
				p0[j] = PII(l_new, r_new);
			}
		}
	}

	sort_i(p0);

	int i = 0;

	if (!p0.empty()) {
		while (p0[i].fi < 0) i++;

		int cur = 1;
		int cur_num = 10;
		while (i < sz0) {
			while (cur <= p0[i].fi)
				a[cur++] = cur_num;

			cur_num--;
			while (cur <= p0[i].se)
				a[cur++] = cur_num;
			i++;
		}

		while (cur <= n)
			a[cur++] = cur_num;
	}
	cout << "YES" << endl;
	for1(i, n)
		cout << a[i] << " ";
	return 0;
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
//#include <regex>

using namespace std;
typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, LL> PDL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector <VI> VVI;
typedef vector <VL> VVL;

typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector< PDL > VPDL;

#define pb push_back
#define fi first
#define se second
const long double eps = 1e-16;
const int MODP = 1000000007;
const int MAXS = 10;
const int MAXP = 50005;

#define for0(x,n) for(int x = 0; x < n; ++x)
#define for1(x,n) for(int x = 1; x <= n; ++x)
#define sort_i(a) sort(a.begin(), a.end());
#define sort_d(a) sort(a.rbegin(), a.rend());
#define summaLL(a) accumulate(a.begin(), a.end(), 0LL);
#define summa(a) accumulate(a.begin(), a.end(), 0);
template <typename T> vector<T> readVector0(int n) { vector<T> res(n); for (int i = 0; i < n; i++) cin >> res[i]; return res; }
template <typename T> vector<T> readVector1(int n) { vector<T> res(n + 1); for (int i = 1; i <= n; i++) cin >> res[i]; return res; }

template <typename T>
bool sortBy2(const pair<T, T> &a,
	const pair<T, T> &b)
{
	return (a.second < b.second);
}

//auto v = readVector<int>(n);

int main() {
	//FILE *str;
	//freopen_s(&str, "test.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	VI a(n + 2, 0);

	int t, l, r;

	VPII p0, p1;

	for0(i, m) {
		cin >> t >> l >> r;
		if (t == 1) {
			p1.pb(PII(l, r));
		}
		else {
			p0.pb(PII(l, r));
		}
	}
	int sz1 = p1.size();
	int sz0 = p0.size();

	for1(i, sz1 - 1) {
		for0(j, i-1) {
			if (p1[i].se > p1[j].fi && p1[j].se > p1[i].fi) { // segments intersect
				p1[i].se = max(p1[i].se, p1[j].se);
				p1[i].fi = min(p1[i].fi, p1[j].fi);
				p1[j].se = p1[j].fi = 2000;
			}
		}
	}
	sort_i(p1);

	for0(i, sz0) {
		for0(j, sz1) {
			if (p1[j].fi <= p0[i].fi && p1[j].se >= p0[i].se) { // segments intersect
				cout << "NO";
				return 0;
			}
		}
	}
	a[0] = n+1;

	for1(i, n) {
		a[i] = a[i - 1] - 1;
	}

	if (sz1 > 0) {
		for0(i, sz1) {
			for (int j = p1[i].fi+1; j <= p1[i].se && j < 1001; j++) {
				a[j] = a[p1[i].fi];
			}
		}
	}
	cout << "YES" << endl;
	for1(i, n)
		cout << a[i] << " ";
	return 0;
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
//#include <regex>

using namespace std;
typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, LL> PDL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector <VI> VVI;
typedef vector <VL> VVL;

typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector< PDL > VPDL;

#define pb push_back
#define fi first
#define se second
const long double eps = 1e-16;
const int MODP = 1000000007;
const int MAXS = 10;
const int MAXP = 50005;

#define for0(x,n) for(int x = 0; x < n; ++x)
#define for1(x,n) for(int x = 1; x <= n; ++x)
#define sort_i(a) sort(a.begin(), a.end());
#define sort_d(a) sort(a.rbegin(), a.rend());
#define summaLL(a) accumulate(a.begin(), a.end(), 0LL);
#define summa(a) accumulate(a.begin(), a.end(), 0);
template <typename T> vector<T> readVector0(int n) { vector<T> res(n); for (int i = 0; i < n; i++) cin >> res[i]; return res; }
template <typename T> vector<T> readVector1(int n) { vector<T> res(n + 1); for (int i = 1; i <= n; i++) cin >> res[i]; return res; }

template <typename T>
bool sortBy2(const pair<T, T> &a,
	const pair<T, T> &b)
{
	return (a.second < b.second);
}

//auto v = readVector<int>(n);

int main() {
	//FILE *str;
	//freopen_s(&str, "test.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	VI a(n + 2, 0);

	int t, l, r;
	VI l1, r1;
	VPII p0;

	for0(i, m) {
		cin >> t >> l >> r;
		if (t == 1) {
			l1.pb(l); r1.pb(r);
		}
		else {
			p0.pb(PII(l, r));
		}
	}
	int sz1 = l1.size();
	int sz0 = p0.size();

	for0(i, sz0) {
		for0(j, sz1) {
			if (l1[j] <= p0[i].fi) {
				if (r1[j] >= p0[i].se) {
					cout << "NO";
					return 0;
				}
				else {
					p0[i].fi = max(p0[i].fi, r1[j]);
				}
			}

			else p0[i].se = min(p0[i].se, l1[j]);
		}
		if (p0[i].se <= p0[i].fi) {
			cout << "YES";
			return 0;
		}
	}

	for1(i, sz0 - 1) {
		for0(j, i-1) {
			int l_new = max(p0[i].fi, p0[j].fi);
			int r_new = min(p0[i].se, p0[j].se);

			if (r_new > l_new) {
				p0[i] = PII(-1, -1);
				p0[j] = PII(l_new, r_new);
			}
		}
	}

	sort_i(p0);

	int i = 0;

	if (!p0.empty()) {
		while (p0[i].fi < 0) i++;

		int cur = 1;
		int cur_num = 10;
		while (i < sz0) {
			while (cur <= p0[i].fi)
				a[cur++] = cur_num;

			cur_num--;
			while (cur <= p0[i].se)
				a[cur++] = cur_num;
			i++;
		}

		while (cur <= n)
			a[cur++] = cur_num;
	}
	cout << "YES" << endl;
	for1(i, n)
		cout << a[i] << " ";
	return 0;
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
//#include <regex>

using namespace std;
typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, LL> PDL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector <VI> VVI;
typedef vector <VL> VVL;

typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector< PDL > VPDL;

#define pb push_back
#define fi first
#define se second
const long double eps = 1e-16;
const int MODP = 1000000007;
const int MAXS = 10;
const int MAXP = 50005;

#define for0(x,n) for(int x = 0; x < n; ++x)
#define for1(x,n) for(int x = 1; x <= n; ++x)
#define sort_i(a) sort(a.begin(), a.end());
#define sort_d(a) sort(a.rbegin(), a.rend());
#define summaLL(a) accumulate(a.begin(), a.end(), 0LL);
#define summa(a) accumulate(a.begin(), a.end(), 0);
template <typename T> vector<T> readVector0(int n) { vector<T> res(n); for (int i = 0; i < n; i++) cin >> res[i]; return res; }
template <typename T> vector<T> readVector1(int n) { vector<T> res(n + 1); for (int i = 1; i <= n; i++) cin >> res[i]; return res; }

template <typename T>
bool sortBy2(const pair<T, T> &a,
	const pair<T, T> &b)
{
	return (a.second < b.second);
}

//auto v = readVector<int>(n);

int main() {
	//FILE *str;
	//freopen_s(&str, "test.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	VI a(n + 2, 0);

	int t, l, r;
	VI l0, r0;
	VPII p1;

	for0(i, m) {
		cin >> t >> l >> r;
		if (t == 1) {
			l0.pb(l); r0.pb(r);
		}
		else {
			p1.pb(PII(l, r));
		}
	}
	int sz0 = l0.size();
	int sz1 = p1.size();

	for0(i, sz1) {
		for0(j, sz0) {
			if (l0[j] <= p1[i].fi) {
				if (r0[j] >= p1[i].se) {
					cout << "NO";
					return 0;
				}
				else {
					p1[i].fi = max(p1[i].fi, r0[j]);
				}
			}

			else p1[i].se = min(p1[i].se, l0[j]);
		}
		if (p1[i].se <= p1[i].fi) {
			cout << "NO";
			return 0;
		}
	}

	for1(i, sz1 - 1) {
		for0(j, i-1) {
			int l_new = max(p1[i].fi, p1[j].fi);
			int r_new = min(p1[i].se, p1[j].se);

			if (r_new > l_new) {
				p1[i] = PII(-1, -1);
				p1[j] = PII(l_new, r_new);
			}
		}
	}

	sort_i(p1);

	int i = 0;
	while (p1[i].fi < 0) i++;

	int cur = 1;
	int cur_num = 10;
	while (i < sz1) {
		while (cur <= p1[i].fi)
			a[cur++] = cur_num;

		cur_num--;
		while (cur <= p1[i].se)
			a[cur++] = cur_num;
		i++;
	}

	while (cur <= n)
		a[cur++] = cur_num;

	for1(i, n)
		cout << a[i] << " ";
	return 0;
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
//#include <regex>

using namespace std;
typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, LL> PDL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector <VI> VVI;
typedef vector <VL> VVL;

typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector< PDL > VPDL;

#define pb push_back
#define fi first
#define se second
const long double eps = 1e-16;
const int MODP = 1000000007;
const int MAXS = 10;
const int MAXP = 50005;

#define for0(x,n) for(int x = 0; x < n; ++x)
#define for1(x,n) for(int x = 1; x <= n; ++x)
#define sort_i(a) sort(a.begin(), a.end());
#define sort_d(a) sort(a.rbegin(), a.rend());
#define summaLL(a) accumulate(a.begin(), a.end(), 0LL);
#define summa(a) accumulate(a.begin(), a.end(), 0);
template <typename T> vector<T> readVector0(int n) { vector<T> res(n); for (int i = 0; i < n; i++) cin >> res[i]; return res; }
template <typename T> vector<T> readVector1(int n) { vector<T> res(n + 1); for (int i = 1; i <= n; i++) cin >> res[i]; return res; }

template <typename T>
bool sortBy2(const pair<T, T> &a,
	const pair<T, T> &b)
{
	return (a.second < b.second);
}

//auto v = readVector<int>(n);

int main() {
	//FILE *str;
	//freopen_s(&str, "test.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	VI a(n + 2, 0);

	int t, l, r;
	VI l1, r1;
	VPII p0;

	for0(i, m) {
		cin >> t >> l >> r;
		if (t == 1) {
			l1.pb(l); r1.pb(r);
		}
		else {
			p0.pb(PII(l, r));
		}
	}
	int sz1 = l1.size();
	int sz0 = p0.size();

	for0(i, sz0) {
		for0(j, sz1) {
			if (l1[j] <= p0[i].fi) {
				if (r1[j] >= p0[i].se) {
					cout << l1[j] << " " << p0[i].fi << " " << r1[j] << " " << p0[i].se;
					return 0;
				}
				else {
					p0[i].fi = max(p0[i].fi, r1[j]);
				}
			}

			else p0[i].se = min(p0[i].se, l1[j]);
		}
		if (p0[i].se <= p0[i].fi) {
			cout << "ANSWER";
			return 0;
		}
	}

	for1(i, sz0 - 1) {
		for0(j, i-1) {
			int l_new = max(p0[i].fi, p0[j].fi);
			int r_new = min(p0[i].se, p0[j].se);

			if (r_new > l_new) {
				p0[i] = PII(-1, -1);
				p0[j] = PII(l_new, r_new);
			}
		}
	}

	sort_i(p0);

	int i = 0;

	if (!p0.empty()) {
		while (p0[i].fi < 0) i++;

		int cur = 1;
		int cur_num = 10;
		while (i < sz0) {
			while (cur <= p0[i].fi)
				a[cur++] = cur_num;

			cur_num--;
			while (cur <= p0[i].se)
				a[cur++] = cur_num;
			i++;
		}

		while (cur <= n)
			a[cur++] = cur_num;
	}
	cout << "YES" << endl;
	for1(i, n)
		cout << a[i] << " ";
	return 0;
}


// created by callmepandey at 20200917 19:56.
// Rules of Optimization:
// Rule 1: Don't do it.
// Rule 2 (for experts only): Don't do it yet

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
vector <ll> primes(1000001,1) , pr;
void prime()
{
  primes[1] = 0;
  for(ll i =2;i*i<1000001;i++)
  {
    if(primes[i])
    {
      for(ll j=i*i;j<1000001;j=j+i)
      {
        primes[j] = 0;
      }
    }
  }
  for(ll i=2;i<1000001;i++)
  {
    if(primes[i])
    pr.pb(i);
  }

}
bool check(ll n)
{
  float x = sqrt((double)n);
  ll y = x;
  if(x==y)
    return true;
  else return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
   ll n , m;
   cin>>n>>m;
   vector <pair<ll , ll>>inc;
   vector <pair<ll , ll>> dec;
   while(m--)
   {
     ll o , i , j;
     cin>>o>>i>>j;
     i-- , j--;
     if(o==1)
     {
       inc.pb({i,j});
     } else dec.pb({i,j});
   }
   ll arr[n] = {0};
   for(auto x:inc)
   {
     for(ll i=x.first;i<=x.second;i++)
     {
       arr[i] = 1;
     }
   }
   ll flag = 0;
   for(auto x:dec)
   {
     flag = 0;
     //cout<<x.first<<" "<<x.second<<endl;
     for(ll i=x.first;i<=x.second;i++)
     {
       if(arr[i]==0)
       {
         flag = 1;
         break;
       }
     }
     if(flag==0&&x.second-x.second>1)
     {
       cout<<"NO"<<endl;
       return 0;
     }
     if(x.first+1==x.second)
     {
       arr[x.second] = 0;
       arr[x.first] = 0;
     }
   }
   ll ans[n] , x = 1000000;
   for(ll i=0;i<n;i++)
   {
     if(arr[i]==0)
     {
       ans[i] = x;
       x = x - 1;
     } else {
       x = x+2;
       ans[i] = x ;
      // x++;
     }
   }
   cout<<"YES"<<endl;
   for(ll i=0;i<n;i++)
   {
     cout<<ans[i]<<" ";
   }
 }
  return 0;

}


// created by callmepandey at 20200917 19:56.
// Rules of Optimization:
// Rule 1: Don't do it.
// Rule 2 (for experts only): Don't do it yet

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
vector <ll> primes(1000001,1) , pr;
void prime()
{
  primes[1] = 0;
  for(ll i =2;i*i<1000001;i++)
  {
    if(primes[i])
    {
      for(ll j=i*i;j<1000001;j=j+i)
      {
        primes[j] = 0;
      }
    }
  }
  for(ll i=2;i<1000001;i++)
  {
    if(primes[i])
    pr.pb(i);
  }

}
bool check(ll n)
{
  float x = sqrt((double)n);
  ll y = x;
  if(x==y)
    return true;
  else return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
   ll n , m;
   cin>>n>>m;
   vector <pair<ll , ll>>inc;
   vector <pair<ll , ll>> dec;
   while(m--)
   {
     ll o , i , j;
     cin>>o>>i>>j;
     i-- , j--;
     if(o==1)
     {
       inc.pb({i,j});
     } else dec.pb({i,j});
   }
   ll arr[n] = {0};
   for(auto x:inc)
   {
     for(ll i=x.first;i<=x.second-1;i++)
     {
       arr[i] = 1;
     }
   }
   ll flag = 0;
   for(auto x:dec)
   {
     flag = 0;
     //cout<<x.first<<" "<<x.second<<endl;
     for(ll i=x.first;i<=x.second;i++)
     {
       if(arr[i]==0)
       {
         flag = 1;
         break;
       }
     }
     if(flag==0)
     {
       cout<<"NO"<<endl;
       return 0;
     }
   }
   ll ans[n] , x = 1000000;
   for(ll i=0;i<n;i++)
   {
     if(arr[i]==0)
     {
       x--;
       ans[i] = x;
       x = x - 1;
     } else {
       ans[i] = x;
       x++;
     }
   }
   cout<<"YES"<<endl;
   for(ll i=0;i<n;i++)
   {
     cout<<ans[i]<<" ";
   }
 }
  return 0;

}


// created by callmepandey at 20200918 12:32.
// Rules of Optimization:
// Rule 1: Don't do it.
// Rule 2 (for experts only): Don't do it yet

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
vector <ll> primes(1000001,1) , pr;
void prime()
{
  primes[1] = 0;
  for(ll i =2;i*i<1000001;i++)
  {
    if(primes[i])
    {
      for(ll j=i*i;j<1000001;j=j+i)
      {
        primes[j] = 0;
      }
    }
  }
  for(ll i=2;i<1000001;i++)
  {
    if(primes[i])
    pr.pb(i);
  }

}
bool check(ll n)
{
  float x = sqrt((double)n);
  ll y = x;
  if(x==y)
    return true;
  else return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
   ll n , m;
   cin>>n>>m;
   vector <pair<ll , ll>>inc;
   vector <pair<ll , ll>> dec;
   while(m--)
   {
     ll o , i , j;
     cin>>o>>i>>j;
     i-- , j--;
     if(o==1)
     {
       inc.pb({i,j});
     } else dec.pb({i,j});
   }
   vector <ll> arr(n,-1);
   ll f=  1;
   for(auto x:inc)
   {
     for(ll i=x.first;i<=x.second;i++)
     {
       arr[i] = f;
    //  f++;
     }
   }
   ll flag = 0;
   for(auto x:dec)
   {
     flag = 0;
     //cout<<x.first<<" "<<x.second<<endl;
     for(ll i=x.first;i<=x.second;i++)
     {
       if(arr[i]==-1)
       {
         flag = 1;
         break;
       }
     }
     if(flag==0&&x.first<x.second-1)
     {
       cout<<"NO"<<endl;
       return 0;
     }
     if(x.first+1==x.second)
     {
       arr[x.second] = -1;
     }
   }
   ll ans[n+1];
   ans[n] = 1000000;
   for(ll i=n-1;i>=1;i--)
   {
     if(arr[i]==-1)
     {
       ans[i] = ans[i+1] + 1;
     } else {
       ans[i] = ans[i+1] - 1;
     }
   }
   cout<<"YES"<<endl;
   for(ll i=1;i<=n;i++)
   {
     cout<<ans[i]<<" ";
   }
 }
  return 0;

}


// created by callmepandey at 20200917 19:56.
// Rules of Optimization:
// Rule 1: Don't do it.
// Rule 2 (for experts only): Don't do it yet

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
vector <ll> primes(1000001,1) , pr;
void prime()
{
  primes[1] = 0;
  for(ll i =2;i*i<1000001;i++)
  {
    if(primes[i])
    {
      for(ll j=i*i;j<1000001;j=j+i)
      {
        primes[j] = 0;
      }
    }
  }
  for(ll i=2;i<1000001;i++)
  {
    if(primes[i])
    pr.pb(i);
  }

}
bool check(ll n)
{
  float x = sqrt((double)n);
  ll y = x;
  if(x==y)
    return true;
  else return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
   ll n , m;
   cin>>n>>m;
   vector <pair<ll , ll>>inc;
   vector <pair<ll , ll>> dec;
   while(m--)
   {
     ll o , i , j;
     cin>>o>>i>>j;
     i-- , j--;
     if(o==1)
     {
       inc.pb({i,j});
     } else dec.pb({i,j});
   }
   ll arr[n] = {0};
   for(auto x:inc)
   {
     for(ll i=x.first;i<=x.second-1;i++)
     {
       arr[i] = 1;
     }
   }
   ll flag = 0;
   for(auto x:dec)
   {
     flag = 0;
     //cout<<x.first<<" "<<x.second<<endl;
     for(ll i=x.first;i<=x.second;i++)
     {
       if(arr[i]==0)
       {
         flag = 1;
         break;
       }
     }
     if(flag==0)
     {
       cout<<"NO"<<endl;
       return 0;
     }
   }
   ll ans[n] , x = 1000;
   for(ll i=0;i<n;i++)
   {
     if(arr[i]==0)
     {
       x++;
       ans[i] = x;
       x = x -2;
       if(i+1<n&&arr[i+1]==0)
       {x--;
       ans[i+1] = x;
       i++;}
     } else {
       ans[i] = x;
       x++;
     }
   }
   cout<<"YES"<<endl;
   for(ll i=0;i<n;i++)
   {
     cout<<ans[i]<<" ";
   }
 }
  return 0;

}


// created by callmepandey at 20200917 19:56.
// Rules of Optimization:
// Rule 1: Don't do it.
// Rule 2 (for experts only): Don't do it yet

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
vector <ll> primes(1000001,1) , pr;
void prime()
{
  primes[1] = 0;
  for(ll i =2;i*i<1000001;i++)
  {
    if(primes[i])
    {
      for(ll j=i*i;j<1000001;j=j+i)
      {
        primes[j] = 0;
      }
    }
  }
  for(ll i=2;i<1000001;i++)
  {
    if(primes[i])
    pr.pb(i);
  }

}
bool check(ll n)
{
  float x = sqrt((double)n);
  ll y = x;
  if(x==y)
    return true;
  else return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
   ll n , m;
   cin>>n>>m;
   vector <pair<ll , ll>>inc;
   vector <pair<ll , ll>> dec;
   while(m--)
   {
     ll o , i , j;
     cin>>o>>i>>j;
     i-- , j--;
     if(o==1)
     {
       inc.pb({i,j});
     } else dec.pb({i,j});
   }
   ll arr[n] = {0};
   for(auto x:inc)
   {
     for(ll i=x.first;i<=x.second;i++)
     {
       arr[i] = 1;
     }
   }
   ll flag = 0;
   for(auto x:dec)
   {
     flag = 0;
     //cout<<x.first<<" "<<x.second<<endl;
     for(ll i=x.first;i<=x.second;i++)
     {
       if(arr[i]==0)
       {
         flag = 1;
         break;
       }
     }
     if(flag==0)
     {
       cout<<"NO"<<endl;
       return 0;
     }
   }
   ll ans[n] , x = 1000000;
   for(ll i=0;i<n;i++)
   {
     if(arr[i]==0)
     {
       x--;
       ans[i] = x;
       x = x - 1;
     } else {
       ans[i] = x;
       x++;
     }
   }
   cout<<"YES"<<endl;
   for(ll i=0;i<n;i++)
   {
     cout<<ans[i]<<" ";
   }
 }
  return 0;

}


// created by callmepandey at 20200917 19:56.
// Rules of Optimization:
// Rule 1: Don't do it.
// Rule 2 (for experts only): Don't do it yet

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
vector <ll> primes(1000001,1) , pr;
void prime()
{
  primes[1] = 0;
  for(ll i =2;i*i<1000001;i++)
  {
    if(primes[i])
    {
      for(ll j=i*i;j<1000001;j=j+i)
      {
        primes[j] = 0;
      }
    }
  }
  for(ll i=2;i<1000001;i++)
  {
    if(primes[i])
    pr.pb(i);
  }

}
bool check(ll n)
{
  float x = sqrt((double)n);
  ll y = x;
  if(x==y)
    return true;
  else return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
   ll n , m;
   cin>>n>>m;
   vector <pair<ll , ll>>inc;
   vector <pair<ll , ll>> dec;
   while(m--)
   {
     ll o , i , j;
     cin>>o>>i>>j;
     i-- , j--;
     if(o==1)
     {
       inc.pb({i,j});
     } else dec.pb({i,j});
   }
   ll arr[n] = {0};
   for(auto x:inc)
   {
     for(ll i=x.first+1;i<=x.second-1;i++)
     {
       arr[i] = 1;
     }
   }
   ll flag = 0;
   for(auto x:dec)
   {
     flag = 0;
     //cout<<x.first<<" "<<x.second<<endl;
     for(ll i=x.first;i<=x.second;i++)
     {
       if(arr[i]==0)
       {
         flag = 1;
         break;
       }
     }
     if(flag==0)
     {
       cout<<"NO"<<endl;
       return 0;
     }
   }
   ll ans[n] , x = 1000;
   for(ll i=0;i<n;i++)
   {
     if(arr[i]==0)
     {
       x++;
       ans[i] = x;
       if(i+1<n&&arr[i+1]==0)
       {x--;
       ans[i+1] = x;
       i++;}
     } else {
       ans[i] = x;
       x++;
     }
   }
   cout<<"YES"<<endl;
   for(ll i=0;i<n;i++)
   {
     cout<<ans[i]<<" ";
   }
 }
  return 0;

}


// created by callmepandey at 20200917 19:56.
// Rules of Optimization:
// Rule 1: Don't do it.
// Rule 2 (for experts only): Don't do it yet

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
vector <ll> primes(1000001,1) , pr;
void prime()
{
  primes[1] = 0;
  for(ll i =2;i*i<1000001;i++)
  {
    if(primes[i])
    {
      for(ll j=i*i;j<1000001;j=j+i)
      {
        primes[j] = 0;
      }
    }
  }
  for(ll i=2;i<1000001;i++)
  {
    if(primes[i])
    pr.pb(i);
  }

}
bool check(ll n)
{
  float x = sqrt((double)n);
  ll y = x;
  if(x==y)
    return true;
  else return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
   ll n , m;
   cin>>n>>m;
   vector <pair<ll , ll>>inc;
   vector <pair<ll , ll>> dec;
   while(m--)
   {
     ll o , i , j;
     cin>>o>>i>>j;
     i-- , j--;
     if(o==1)
     {
       inc.pb({i,j});
     } else dec.pb({i,j});
   }
   ll arr[n] = {0};
   for(auto x:inc)
   {
     for(ll i=x.first;i<=x.second;i++)
     {
       arr[i] = 1;
     }
   }
   ll flag = 0;
   for(auto x:dec)
   {
     flag = 0;
     //cout<<x.first<<" "<<x.second<<endl;
     for(ll i=x.first;i<=x.second;i++)
     {
       if(arr[i]==0)
       {
         flag = 1;
         break;
       }
     }
     if(flag==0&&x.second-x.second>1)
     {
       cout<<"NO"<<endl;
       return 0;
     }
     if(x.first+1==x.second)
     {
       arr[x.second] = 0;
     }
   }
   ll ans[n] , x = 1000000;
   for(ll i=0;i<n;i++)
   {
     if(arr[i]==0)
     {
       x--;
       ans[i] = x;
       x = x - 1;
     } else {
       ans[i] = x;
       x++;
     }
   }
   cout<<"YES"<<endl;
   for(ll i=0;i<n;i++)
   {
     cout<<ans[i]<<" ";
   }
 }
  return 0;

}


// created by callmepandey at 20200917 19:56.
// Rules of Optimization:
// Rule 1: Don't do it.
// Rule 2 (for experts only): Don't do it yet

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
vector <ll> primes(1000001,1) , pr;
void prime()
{
  primes[1] = 0;
  for(ll i =2;i*i<1000001;i++)
  {
    if(primes[i])
    {
      for(ll j=i*i;j<1000001;j=j+i)
      {
        primes[j] = 0;
      }
    }
  }
  for(ll i=2;i<1000001;i++)
  {
    if(primes[i])
    pr.pb(i);
  }

}
bool check(ll n)
{
  float x = sqrt((double)n);
  ll y = x;
  if(x==y)
    return true;
  else return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
   ll n , m;
   cin>>n>>m;
   vector <pair<ll , ll>>inc;
   vector <pair<ll , ll>> dec;
   while(m--)
   {
     ll o , i , j;
     cin>>o>>i>>j;
     i-- , j--;
     if(o==1)
     {
       inc.pb({i,j});
     } else dec.pb({i,j});
   }
   ll arr[n] = {0};
   for(auto x:inc)
   {
     for(ll i=x.first;i<=x.second;i++)
     {
       arr[i] = 1;
     }
   }
   ll flag = 0;
   for(auto x:dec)
   {
     flag = 0;
     //cout<<x.first<<" "<<x.second<<endl;
     for(ll i=x.first;i<=x.second;i++)
     {
       if(arr[i]==0)
       {
         flag = 1;
         break;
       }
     }
     if(flag==0&&x.second-x.second>1)
     {
       cout<<"NO"<<endl;
       return 0;
     }
     if(x.first+1==x.second)
     {
       arr[x.second] = 0;
       arr[x.first] = 0;
     }
   }
   ll ans[n] , x = 1000000;
   for(ll i=0;i<n;i++)
   {
     if(arr[i]==0)
     {
       x--;
       ans[i] = x;
       x = x - 1;
     } else {
       x = x+2;
       ans[i] = x ;
      // x++;
     }
   }
   cout<<"YES"<<endl;
   for(ll i=0;i<n;i++)
   {
     cout<<ans[i]<<" ";
   }
 }
  return 0;

}


// created by callmepandey at 20200917 19:56.
// Rules of Optimization:
// Rule 1: Don't do it.
// Rule 2 (for experts only): Don't do it yet

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
vector <ll> primes(1000001,1) , pr;
void prime()
{
  primes[1] = 0;
  for(ll i =2;i*i<1000001;i++)
  {
    if(primes[i])
    {
      for(ll j=i*i;j<1000001;j=j+i)
      {
        primes[j] = 0;
      }
    }
  }
  for(ll i=2;i<1000001;i++)
  {
    if(primes[i])
    pr.pb(i);
  }

}
bool check(ll n)
{
  float x = sqrt((double)n);
  ll y = x;
  if(x==y)
    return true;
  else return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
   ll n , m;
   cin>>n>>m;
   vector <pair<ll , ll>>inc;
   vector <pair<ll , ll>> dec;
   while(m--)
   {
     ll o , i , j;
     cin>>o>>i>>j;
     i-- , j--;
     if(o==1)
     {
       inc.pb({i,j});
     } else dec.pb({i,j});
   }
   ll arr[n] = {0};
   for(auto x:inc)
   {
     for(ll i=x.first;i<=x.second;i++)
     {
       arr[i] = 1;
     }
   }
   ll flag = 0;
   for(auto x:dec)
   {
     flag = 0;
     //cout<<x.first<<" "<<x.second<<endl;
     for(ll i=x.first;i<=x.second;i++)
     {
       if(arr[i]==0)
       {
         flag = 1;
         break;
       }
     }
     if(flag==0&&x.second-x.second>1)
     {
       cout<<"NO"<<endl;
       return 0;
     }
     if(x.first+1==x.second)
     {
       arr[x.second] = 0;
       arr[x.first] = 0;
     }
   }
   ll ans[n] , x = 1000000;
   for(ll i=0;i<n;i++)
   {
     if(arr[i]==0)
     {
       x--;
       ans[i] = x;
       x = x - 1;
     } else {
       ans[i] = x;
       x++;
     }
   }
   cout<<"YES"<<endl;
   for(ll i=0;i<n;i++)
   {
     cout<<ans[i]<<" ";
   }
 }
  return 0;

}


// created by callmepandey at 20200918 13:17.
// Rules of Optimization:
// Rule 1: Don't do it.
// Rule 2 (for experts only): Don't do it yet

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
vector <ll> primes(1000001,1) , pr;
void prime()
{
  primes[1] = 0;
  for(ll i =2;i*i<1000001;i++)
  {
    if(primes[i])
    {
      for(ll j=i*i;j<1000001;j=j+i)
      {
        primes[j] = 0;
      }
    }
  }
  for(ll i=2;i<1000001;i++)
  {
    if(primes[i])
    pr.pb(i);
  }

}
bool check(ll n)
{
  float x = sqrt((double)n);
  ll y = x;
  if(x==y)
    return true;
  else return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
   ll n , m;
   cin>>n>>m;
   vector <pair<ll , ll>>inc , dec;
   while(m--)
   {
     ll o , i , j;
     cin>>o>>i>>j;
     if(o==1)
     {
       inc.pb({i,j});
     } else dec.pb({i,j});
   }
   vector <ll> arr(n,-1);
   for(auto x:inc)
   {
     for(ll i=x.first;i<x.second;i++)
     {
       arr[i] = 1;
    //  f++;
     }
   }
   ll flag = 0;
   for(auto x:dec)
   {
     flag = 0;
     //cout<<x.first<<" "<<x.second<<endl;
     for(ll i=x.first;i<x.second;i++)
     {
       if(arr[i]==-1||arr[i]==0)
       {
         arr[i] = 0;
         flag = 1;
       }
     }
     if(flag==0)
     {
       cout<<"NO"<<endl;
       return 0;
     }

   }

   ll ans[n+1];
   ans[1] = 1000001;
   for(ll i=2;i<=n;i++)
   {
     if(arr[i-1]!=0)
     {
       ans[i] = ans[i-1] + 1 ;
     } else {
       ans[i] = ans[i-1] - 1 ;
     }
   }
   cout<<"YES"<<endl;
   for(ll i=1;i<=n;i++)
   {
     cout<<ans[i]<<" ";
   }
 }
  return 0;

}


// created by callmepandey at 20200918 12:32.
// Rules of Optimization:
// Rule 1: Don't do it.
// Rule 2 (for experts only): Don't do it yet

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
vector <ll> primes(1000001,1) , pr;
void prime()
{
  primes[1] = 0;
  for(ll i =2;i*i<1000001;i++)
  {
    if(primes[i])
    {
      for(ll j=i*i;j<1000001;j=j+i)
      {
        primes[j] = 0;
      }
    }
  }
  for(ll i=2;i<1000001;i++)
  {
    if(primes[i])
    pr.pb(i);
  }

}
bool check(ll n)
{
  float x = sqrt((double)n);
  ll y = x;
  if(x==y)
    return true;
  else return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
   ll n , m;
   cin>>n>>m;
   vector <pair<ll , ll>>inc;
   vector <pair<ll , ll>> dec;
   while(m--)
   {
     ll o , i , j;
     cin>>o>>i>>j;
     i-- , j--;
     if(o==1)
     {
       inc.pb({i,j});
     } else dec.pb({i,j});
   }
   ll arr[n] = {0} , f =  1;
   for(auto x:inc)
   {
     for(ll i=x.first+1;i<=x.second;i++)
     {
       arr[i] = f;
      f++;
     }
   }
   ll flag = 0;
   for(auto x:dec)
   {
     flag = 0;
     //cout<<x.first<<" "<<x.second<<endl;
     for(ll i=x.first;i<=x.second;i++)
     {
       if(arr[i]==0)
       {
         flag = 1;
         break;
       }
     }
     if(flag==0)
     {
       cout<<"NO"<<endl;
       return 0;
     }
   }
   ll ans[n] , x = -1;
   for(ll i=0;i<n;i++)
   {
     if(arr[i]==0)
     {
       arr[i] = x;
       x--;
     }
   }
   cout<<"YES"<<endl;
   for(ll i=0;i<n;i++)
   {
     cout<<arr[i]+1000<<" ";
   }
 }
  return 0;

}


// created by callmepandey at 20200918 13:17.
// Rules of Optimization:
// Rule 1: Don't do it.
// Rule 2 (for experts only): Don't do it yet

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
vector <ll> primes(1000001,1) , pr;
void prime()
{
  primes[1] = 0;
  for(ll i =2;i*i<1000001;i++)
  {
    if(primes[i])
    {
      for(ll j=i*i;j<1000001;j=j+i)
      {
        primes[j] = 0;
      }
    }
  }
  for(ll i=2;i<1000001;i++)
  {
    if(primes[i])
    pr.pb(i);
  }

}
bool check(ll n)
{
  float x = sqrt((double)n);
  ll y = x;
  if(x==y)
    return true;
  else return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
   ll n , m;
   cin>>n>>m;
   vector <pair<ll , ll>>inc;
   vector <pair<ll , ll>> dec;
   while(m--)
   {
     ll o , i , j;
     cin>>o>>i>>j;
     i-- , j--;
     if(o==1)
     {
       inc.pb({i,j});
     } else dec.pb({i,j});
   }
   vector <ll> arr(n+1,-1);
   ll f=  1;
   for(auto x:inc)
   {
     for(ll i=x.first;i<x.second;i++)
     {

       arr[i] = 1;
    //  f++;
     }
   }
   ll flag = 0;
   for(auto x:dec)
   {
     flag = 0;
     //cout<<x.first<<" "<<x.second<<endl;
     for(ll i=x.first;i<x.second;i++)
     {
       if(arr[i]==-1)
       {
         arr[i] = 0;
         flag = 1;
       }
     }
     if(flag==0)
     {
       cout<<"NO"<<endl;
       return 0;
     }

   }

   ll ans[n+1];
   ans[1] = 1000001;
   for(ll i=2;i<=n;i++)
   {
     if(arr[i-2]!=0)
     {
       ans[i] = ans[i-1] ;
     } else {
       ans[i] = ans[i-1] - 1 ;
     }
   }
   cout<<"YES"<<endl;
   for(ll i=1;i<=n;i++)
   {
     cout<<ans[i]<<" ";
   }
 }
  return 0;

}


// created by callmepandey at 20200917 19:56.
// Rules of Optimization:
// Rule 1: Don't do it.
// Rule 2 (for experts only): Don't do it yet

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
vector <ll> primes(1000001,1) , pr;
void prime()
{
  primes[1] = 0;
  for(ll i =2;i*i<1000001;i++)
  {
    if(primes[i])
    {
      for(ll j=i*i;j<1000001;j=j+i)
      {
        primes[j] = 0;
      }
    }
  }
  for(ll i=2;i<1000001;i++)
  {
    if(primes[i])
    pr.pb(i);
  }

}
bool check(ll n)
{
  float x = sqrt((double)n);
  ll y = x;
  if(x==y)
    return true;
  else return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
   ll n , m;
   cin>>n>>m;
   vector <pair<ll , ll>>inc;
   vector <pair<ll , ll>> dec;
   while(m--)
   {
     ll o , i , j;
     cin>>o>>i>>j;
     i-- , j--;
     if(o==1)
     {
       inc.pb({i,j});
     } else dec.pb({i,j});
   }
   ll arr[n] = {0};
   for(auto x:inc)
   {
     for(ll i=x.first;i<=x.second-1;i++)
     {
       arr[i] = 1;
     }
   }
   ll flag = 0;
   for(auto x:dec)
   {
     flag = 0;
     //cout<<x.first<<" "<<x.second<<endl;
     for(ll i=x.first;i<=x.second;i++)
     {
       if(arr[i]==0)
       {
         flag = 1;
         break;
       }
     }
     if(flag==0)
     {
       cout<<"NO"<<endl;
       return 0;
     }
   }
   ll ans[n] , x = 1000;
   for(ll i=0;i<n;i++)
   {
     if(arr[i]==0)
     {
       x--;
       ans[i] = x;
       x = x -2;
     } else {
       ans[i] = x;
       x++;
     }
   }
   cout<<"YES"<<endl;
   for(ll i=0;i<n;i++)
   {
     cout<<ans[i]<<" ";
   }
 }
  return 0;

}


// created by callmepandey at 20200917 19:56.
// Rules of Optimization:
// Rule 1: Don't do it.
// Rule 2 (for experts only): Don't do it yet

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
vector <ll> primes(1000001,1) , pr;
void prime()
{
  primes[1] = 0;
  for(ll i =2;i*i<1000001;i++)
  {
    if(primes[i])
    {
      for(ll j=i*i;j<1000001;j=j+i)
      {
        primes[j] = 0;
      }
    }
  }
  for(ll i=2;i<1000001;i++)
  {
    if(primes[i])
    pr.pb(i);
  }

}
bool check(ll n)
{
  float x = sqrt((double)n);
  ll y = x;
  if(x==y)
    return true;
  else return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
   ll n , m;
   cin>>n>>m;
   vector <pair<ll , ll>>inc;
   vector <pair<ll , ll>> dec;
   while(m--)
   {
     ll o , i , j;
     cin>>o>>i>>j;
     i-- , j--;
     if(o==1)
     {
       inc.pb({i,j});
     } else dec.pb({i,j});
   }
   ll arr[n] = {0};
   for(auto x:inc)
   {
     for(ll i=x.first;i<=x.second-1;i++)
     {
       arr[i] = 1;
     }
   }
   ll flag = 0;
   for(auto x:dec)
   {
     flag = 0;
     //cout<<x.first<<" "<<x.second<<endl;
     for(ll i=x.first;i<=x.second;i++)
     {
       if(arr[i]==0)
       {
         flag = 1;
         break;
       }
     }
     if(flag==0)
     {
       cout<<"NO"<<endl;
       return 0;
     }
   }
   ll ans[n] , x = 1000;
   for(ll i=0;i<n;i++)
   {
     if(arr[i]==0)
     {
       x--;
       ans[i] = x;
       x = x -2;
       if(i+1<n&&arr[i+1]==0)
       {x--;
       ans[i+1] = x;
       i++;}
     } else {
       ans[i] = x;
       x++;
     }
   }
   cout<<"YES"<<endl;
   for(ll i=0;i<n;i++)
   {
     cout<<ans[i]<<" ";
   }
 }
  return 0;

}


// created by callmepandey at 20200917 19:56.
// Rules of Optimization:
// Rule 1: Don't do it.
// Rule 2 (for experts only): Don't do it yet

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
vector <ll> primes(1000001,1) , pr;
void prime()
{
  primes[1] = 0;
  for(ll i =2;i*i<1000001;i++)
  {
    if(primes[i])
    {
      for(ll j=i*i;j<1000001;j=j+i)
      {
        primes[j] = 0;
      }
    }
  }
  for(ll i=2;i<1000001;i++)
  {
    if(primes[i])
    pr.pb(i);
  }

}
bool check(ll n)
{
  float x = sqrt((double)n);
  ll y = x;
  if(x==y)
    return true;
  else return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
   ll n , m;
   cin>>n>>m;
   vector <pair<ll , ll>>inc;
   vector <pair<ll , ll>> dec;
   while(m--)
   {
     ll o , i , j;
     cin>>o>>i>>j;
     i-- , j--;
     if(o==1)
     {
       inc.pb({i,j});
     } else dec.pb({i,j});
   }
   ll arr[n] = {0};
   for(auto x:inc)
   {
     for(ll i=x.first;i<=x.second-1;i++)
     {
       arr[i] = 1;
     }
   }
   ll flag = 0;
   for(auto x:dec)
   {
     flag = 0;
     //cout<<x.first<<" "<<x.second<<endl;
     for(ll i=x.first;i<=x.second;i++)
     {
       if(arr[i]==0)
       {
         flag = 1;
         break;
       }
     }
     if(flag==0)
     {
       cout<<"NO"<<endl;
       return 0;
     }
   }
   ll ans[n] , x = 1000;
   for(ll i=0;i<n;i++)
   {
     if(arr[i]==0)
     {
       x++;
       ans[i] = x;
       if(i+1<n&&arr[i+1]==0)
       {x--;
       ans[i+1] = x;
       i++;}
     } else {
       ans[i] = x;
       x++;
     }
   }
   cout<<"YES"<<endl;
   for(ll i=0;i<n;i++)
   {
     cout<<ans[i]<<" ";
   }
 }
  return 0;

}


// created by callmepandey at 20200918 13:17.
// Rules of Optimization:
// Rule 1: Don't do it.
// Rule 2 (for experts only): Don't do it yet

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
vector <ll> primes(1000001,1) , pr;
void prime()
{
  primes[1] = 0;
  for(ll i =2;i*i<1000001;i++)
  {
    if(primes[i])
    {
      for(ll j=i*i;j<1000001;j=j+i)
      {
        primes[j] = 0;
      }
    }
  }
  for(ll i=2;i<1000001;i++)
  {
    if(primes[i])
    pr.pb(i);
  }

}
bool check(ll n)
{
  float x = sqrt((double)n);
  ll y = x;
  if(x==y)
    return true;
  else return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
   ll n , m;
   cin>>n>>m;
   vector <pair<ll , ll>>inc , dec;
   while(m--)
   {
     ll o , i , j;
     cin>>o>>i>>j;
     if(o==1)
     {
       inc.pb({i,j});
     } else dec.pb({i,j});
   }
   vector <ll> arr(n,-1);
   ll f=  1;
   for(auto x:inc)
   {
     for(ll i=x.first;i<x.second;i++)
     {

       arr[i] = 1;
    //  f++;
     }
   }
   ll flag = 0;
   for(auto x:dec)
   {
     flag = 0;
     //cout<<x.first<<" "<<x.second<<endl;
     for(ll i=x.first;i<x.second;i++)
     {
       if(arr[i]==-1)
       {
         arr[i] = 0;
         flag = 1;
       }
     }
     if(flag==0)
     {
       cout<<"NO"<<endl;
       return 0;
     }

   }

   ll ans[n+1];
   ans[1] = 1000001;
   for(ll i=2;i<=n;i++)
   {
     if(arr[i-1]!=0)
     {
       ans[i] = ans[i-1] ;
     } else {
       ans[i] = ans[i-1] - 1 ;
     }
   }
   cout<<"YES"<<endl;
   for(ll i=1;i<=n;i++)
   {
     cout<<ans[i]<<" ";
   }
 }
  return 0;

}


// created by callmepandey at 20200918 12:32.
// Rules of Optimization:
// Rule 1: Don't do it.
// Rule 2 (for experts only): Don't do it yet

#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
#define REP(i,k,n) for (i = k; i <= n; ++i)
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
vector <ll> primes(1000001,1) , pr;
void prime()
{
  primes[1] = 0;
  for(ll i =2;i*i<1000001;i++)
  {
    if(primes[i])
    {
      for(ll j=i*i;j<1000001;j=j+i)
      {
        primes[j] = 0;
      }
    }
  }
  for(ll i=2;i<1000001;i++)
  {
    if(primes[i])
    pr.pb(i);
  }

}
bool check(ll n)
{
  float x = sqrt((double)n);
  ll y = x;
  if(x==y)
    return true;
  else return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   //freopen("error.txt", "w", stderr);
   freopen("output.txt", "w", stdout);
#endif

 ll T = 1 ;
 //cin>>T;

 for(ll t=0;t<T;t++)
 {
   ll n , m;
   cin>>n>>m;
   vector <pair<ll , ll>>inc;
   vector <pair<ll , ll>> dec;
   while(m--)
   {
     ll o , i , j;
     cin>>o>>i>>j;
     i-- , j--;
     if(o==1)
     {
       inc.pb({i,j});
     } else dec.pb({i,j});
   }
   vector <ll> arr(n,-1);
   ll f=  1;
   for(auto x:inc)
   {
     for(ll i=x.first+1;i<=x.second;i++)
     {
       arr[i] = f;
    //  f++;
     }
   }
   ll flag = 0;
   for(auto x:dec)
   {
     flag = 0;
     //cout<<x.first<<" "<<x.second<<endl;
     for(ll i=x.first;i<=x.second;i++)
     {
       if(arr[i]==-1)
       {
         flag = 1;
         break;
       }
     }
     if(flag==0)
     {
       cout<<"NO"<<endl;
       return 0;
     }
   }
   ll ans[n+1];
   ans[n] = 1000000;
   for(ll i=n-1;i>=1;i--)
   {
     if(arr[i]==-1)
     {
       ans[i] = ans[i+1] + 1;
     } else {
       ans[i] = ans[i+1] - 1;
     }
   }
   cout<<"YES"<<endl;
   for(ll i=1;i<=n;i++)
   {
     cout<<ans[i]<<" ";
   }
 }
  return 0;

}