#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
struct tree
{
int l,r,c;
};
struct tree d[400000];
int n,m,f,a[100005],b[100005],q[100005],ans[100005];
void buildtree(int i,int l,int r)
{
d[i].l=l; d[i].r=r; d[i].c=0;
if (l==r) return;
buildtree(i*2,l,(l+r)/2);
buildtree(i*2+1,(l+r)/2+1,r);
}
void _insert(int i,int l,int r,int c)
{
int t=(d[i].l+d[i].r)/2;
if (d[i].l==l && d[i].r==r) d[i].c=d[i].c|c;
else if (r<=t) _insert(i*2,l,r,c);
else if (l>t) _insert(i*2+1,l,r,c);
else
{
_insert(i*2,l,t,c);
_insert(i*2+1,t+1,r,c);
}
}
int _count(int i,int l,int r)
{
int t=(d[i].l+d[i].r)/2;
if (d[i].l==l && d[i].r==r) return d[i].c;
else if (r<=t) return _count(i*2,l,r);
else if (l>t) return _count(i*2+1,l,r);
else return _count(i*2,l,t)&_count(i*2+1,t+1,r);
}
int solve(int i)
{
if (i!=1) d[i].c|=d[i/2].c;
if (d[i].l==d[i].r) ans[d[i].l]=d[i].c;
else
{
solve(i*2);
solve(i*2+1);
}
}
int main()
{
scanf("%d%d",&n,&m);
buildtree(1,1,n);
for (int i=1;i<=m;i++)
{
scanf("%d%d%d",&a[i],&b[i],&q[i]);
_insert(1,a[i],b[i],q[i]);
}
int flag=0;
for (int i=1;i<=m;i++)
if (_count(1,a[i],b[i])!=q[i])
{
flag=1;
break;
}
if (flag) printf("NO\n");
else
{
solve(1);
printf("YES\n");
for (int i=1;i<=n;i++) printf("%d ",ans[i]);
}
return 0;
}