#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <map>
#include <vector>
#include <set>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cctype>
#include <cmath>
#include <fstream>

using namespace std;

typedef long long ll;
#define REP(i,k) for(int (i)=0;(i)<(k);(i)++)
#define INF ~(1<<31)
#define CLR(a) memset((a),0,sizeof((a)))
#define EPS 1e-9
#define DBG 1
#define D(s,v) if(DBG) cout<<(s)<<": "<<(v)<<endl;
#define DVEC(s,v) if(DBG) {cout<<(s)<<": "; for(int i=0;i<(v).size();i++) cout<<(v)[i]<<" "; cout<<endl;}
#define DARR(s,v,n) if(DBG) {cout<<(s)<<": "; for(int i=0;i<n;i++) cout<<(v)[i]<<" "; cout<<endl;}

#define MOD 1000000007
#define NUMBITS 31

int N;
int L[32][200005], R[32][200005], V[32][200005];
int INDEX_TO_NODE[32][100005];
vector<int> a;

void build(int node, int l, int r, int bit){
    L[bit][node] = l;
    R[bit][node] = r;
    if(l==r){
        INDEX_TO_NODE[bit][l] = node;
        return;
    }
    int mid = (l+r)/2;
    build(2*node+1, l, mid, bit);
    build(2*node+2, mid+1, r, bit);
}

void build_tree(int n, int bits){
    N = n;
    CLR(L);
    CLR(R);
    CLR(V);
    CLR(INDEX_TO_NODE);

    for(int bit=0;bit<bits;bit++){
        build(0, 0, n-1, bit);
    }
}

void add(int idx, int v, int bit){
    int node = INDEX_TO_NODE[bit][idx];
    while(true){
        V[bit][node] += v;
        if(node==0) break;
        node = (node-1) / 2;
    }
}

void add_range(int l, int r, int v, int bit){
    add(l, v, bit);
    if(r+1 < N)
        add(r+1, -v, bit);
}

int query_sum(int node, int l, int r, int bit){
    //cout<<"query: "<<pos<<" L:"<<L[bit][pos]<<" R:"<<R[bit][pos]<<" l: "<<l<<" r: "<<r<<endl;
    if(R[bit][node] < l || L[bit][node] > r)
        return 0;
    else if(L[bit][node]>=l && R[bit][node]<=r)
        return V[bit][node];

    return query_sum(2*node+1, l, r, bit) +
    query_sum(2*node+2, l, r, bit);
}

void compute_prefix_sum(){
    for(int b=0;b<NUMBITS;b++){
        int prefix_sum = 0;

        for(int i=0;i<N;i++){
            int cur = query_sum(0, i, i, b);
            //cout<<"b: "<<b<<" i: "<<i<<" cur: "<<cur<<endl;
            prefix_sum += cur;
            add(i, -cur, b);
            if(prefix_sum > 0)
                add(i, 1, b);
        }
    }
}

int main(){
    int n,m;
    while(cin>>n>>m){
        build_tree(n, NUMBITS);

        vector<int> ls,rs,qs;
        for(int i=0;i<m;i++){
            int l,r,q;
            cin>>l>>r>>q;
            l--;
            r--;
            ls.push_back(l);
            rs.push_back(r);
            qs.push_back(q);
            for(int b=0;b<NUMBITS;b++){
                if((q>>b) & 1){
                    add_range(l, r, 1, b);
                }
            }
        }

        // for(int i=0;i<n;i++){
        //     for(int bit=0;bit<3;bit++)
        //         cout<<query_sum(0, i, i, bit);
        //     cout<<endl;
        // }
        // cout<<"================"<<endl;
        compute_prefix_sum();
        // for(int i=0;i<n;i++){
        //     for(int bit=0;bit<3;bit++)
        //         cout<<query_sum(0, i, i, bit);
        //     cout<<endl;
        // }

        bool good = 1;
        for(int i=0;i<m;i++){
            int l = ls[i];
            int r = rs[i];
            int q = qs[i];
            for(int b=0;b<NUMBITS;b++){
                int numset = query_sum(0,l,r,b);
                // if(((q>>b) & 1) && numset != r-l+1){
                //     cout<<"ERROR q: "<<q<<" l: "<<l<<" r:"<<r<<" b: "<<b<<" numset:"<<numset<<" expected numset: "<<(r-l+1)<<endl;
                // }
                if(!((q>>b) & 1)){
                    if(numset == r-l+1){
                        good = 0;
                    }
                }
            }
        }
        if(!good){
            cout<<"NO"<<endl;
        } else{
            cout<<"YES"<<endl;
            for(int i=0;i<n;i++){
                int res = 0;
                for(int b=0;b<NUMBITS;b++){
                    res |= (query_sum(0,i,i,b) << b);
                }
                cout<<res<<" ";
            }
            cout<<endl;
        }
    }
}


#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <map>
#include <vector>
#include <set>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cctype>
#include <cmath>
#include <fstream>

using namespace std;

typedef long long ll;
#define REP(i,k) for(int (i)=0;(i)<(k);(i)++)
#define INF ~(1<<31)
#define CLR(a) memset((a),0,sizeof((a)))
#define EPS 1e-9
#define DBG 1
#define D(s,v) if(DBG) cout<<(s)<<": "<<(v)<<endl;
#define DVEC(s,v) if(DBG) {cout<<(s)<<": "; for(int i=0;i<(v).size();i++) cout<<(v)[i]<<" "; cout<<endl;}
#define DARR(s,v,n) if(DBG) {cout<<(s)<<": "; for(int i=0;i<n;i++) cout<<(v)[i]<<" "; cout<<endl;}

#define MOD 1000000007
#define NUMBITS 31

int N;
int L[32][264005], R[32][264005], V[32][264005];
int INDEX_TO_NODE[32][100005];
vector<int> a;

void build(int node, int l, int r, int bit){
    L[bit][node] = l;
    R[bit][node] = r;
    if(l==r){
        INDEX_TO_NODE[bit][l] = node;
        return;
    }
    int mid = (l+r)/2;
    build(2*node+1, l, mid, bit);
    build(2*node+2, mid+1, r, bit);
}

void build_tree(int n, int bits){
    N = n;
    CLR(L);
    CLR(R);
    CLR(V);
    CLR(INDEX_TO_NODE);

    for(int bit=0;bit<bits;bit++){
        build(0, 0, n-1, bit);
    }
}

void add(int idx, int v, int bit){
    int node = INDEX_TO_NODE[bit][idx];
    while(true){
        V[bit][node] += v;
        if(node==0) break;
        node = (node-1) / 2;
    }
}

void add_range(int l, int r, int v, int bit){
    add(l, v, bit);
    if(r+1 < N)
        add(r+1, -v, bit);
}

int query_sum(int node, int l, int r, int bit){
    //cout<<"query: "<<pos<<" L:"<<L[bit][pos]<<" R:"<<R[bit][pos]<<" l: "<<l<<" r: "<<r<<endl;
    if(R[bit][node] < l || L[bit][node] > r)
        return 0;
    else if(L[bit][node]>=l && R[bit][node]<=r)
        return V[bit][node];

    return query_sum(2*node+1, l, r, bit) +
    query_sum(2*node+2, l, r, bit);
}

void compute_prefix_sum(){
    for(int b=0;b<NUMBITS;b++){
        int prefix_sum = 0;

        for(int i=0;i<N;i++){
            int cur = query_sum(0, i, i, b);
            //cout<<"b: "<<b<<" i: "<<i<<" cur: "<<cur<<endl;
            prefix_sum += cur;
            add(i, -cur + (prefix_sum > 0? 1: 0), b);
        }
    }
}

int main(){
    int n,m;
    while(cin>>n>>m){
        build_tree(n, NUMBITS);

        vector<int> ls,rs,qs;
        for(int i=0;i<m;i++){
            int l,r,q;
            cin>>l>>r>>q;
            l--;
            r--;
            ls.push_back(l);
            rs.push_back(r);
            qs.push_back(q);
            for(int b=0;b<NUMBITS;b++){
                if((q>>b) & 1){
                    add_range(l, r, 1, b);
                }
            }
        }

        // for(int i=0;i<n;i++){
        //     for(int bit=0;bit<3;bit++)
        //         cout<<query_sum(0, i, i, bit);
        //     cout<<endl;
        // }
        // cout<<"================"<<endl;
        compute_prefix_sum();
        // for(int i=0;i<n;i++){
        //     for(int bit=0;bit<3;bit++)
        //         cout<<query_sum(0, i, i, bit);
        //     cout<<endl;
        // }

        bool good = 1;
        for(int i=0;i<m;i++){
            int l = ls[i];
            int r = rs[i];
            int q = qs[i];
            for(int b=0;b<NUMBITS;b++){
                int numset = query_sum(0,l,r,b);
                // if(((q>>b) & 1) && numset != r-l+1){
                //     cout<<"ERROR q: "<<q<<" l: "<<l<<" r:"<<r<<" b: "<<b<<" numset:"<<numset<<" expected numset: "<<(r-l+1)<<endl;
                // }
                if(!((q>>b) & 1)){
                    if(numset == r-l+1){
                        good = 0;
                    }
                }
            }
        }
        if(!good){
            cout<<"NO"<<endl;
        } else{
            cout<<"YES"<<endl;
            for(int i=0;i<n;i++){
                int res = 0;
                for(int b=0;b<NUMBITS;b++){
                    res |= (query_sum(0,i,i,b) << b);
                }
                cout<<res<<" ";
            }
            cout<<endl;
        }
    }
}


#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <map>
#include <vector>
#include <set>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cctype>
#include <cmath>
#include <fstream>

using namespace std;

typedef long long ll;
#define REP(i,k) for(int (i)=0;(i)<(k);(i)++)
#define INF ~(1<<31)
#define CLR(a) memset((a),0,sizeof((a)))
#define EPS 1e-9
#define DBG 1
#define D(s,v) if(DBG) cout<<(s)<<": "<<(v)<<endl;
#define DVEC(s,v) if(DBG) {cout<<(s)<<": "; for(int i=0;i<(v).size();i++) cout<<(v)[i]<<" "; cout<<endl;}
#define DARR(s,v,n) if(DBG) {cout<<(s)<<": "; for(int i=0;i<n;i++) cout<<(v)[i]<<" "; cout<<endl;}

#define MOD 1000000007
#define NUMBITS 31

// int L[32][264005], R[32][264005], V[32][264005];
// int INDEX_TO_NODE[32][100005];
// vector<int> a;

// void build(int node, int l, int r, int bit){
//     L[bit][node] = l;
//     R[bit][node] = r;
//     if(l==r){
//         INDEX_TO_NODE[bit][l] = node;
//         return;
//     }
//     int mid = (l+r)/2;
//     build(2*node+1, l, mid, bit);
//     build(2*node+2, mid+1, r, bit);
// }

// void build_tree(int n, int bits){
//     N = n;
//     CLR(L);
//     CLR(R);
//     CLR(V);
//     CLR(INDEX_TO_NODE);

//     for(int bit=0;bit<bits;bit++){
//         build(0, 0, n-1, bit);
//     }
// }

// void add(int idx, int v, int bit){
//     int node = INDEX_TO_NODE[bit][idx];
//     while(true){
//         V[bit][node] += v;
//         if(node==0) break;
//         node = (node-1) / 2;
//     }
// }

// void add_range(int l, int r, int v, int bit){
//     add(l, v, bit);
//     if(r+1 < N)
//         add(r+1, -v, bit);
// }

// int query_sum(int node, int l, int r, int bit){
//     //cout<<"query: "<<pos<<" L:"<<L[bit][pos]<<" R:"<<R[bit][pos]<<" l: "<<l<<" r: "<<r<<endl;
//     if(R[bit][node] < l || L[bit][node] > r)
//         return 0;
//     else if(L[bit][node]>=l && R[bit][node]<=r)
//         return V[bit][node];

//     return query_sum(2*node+1, l, r, bit) +
//     query_sum(2*node+2, l, r, bit);
// }

// void compute_prefix_sum(){
//     for(int b=0;b<NUMBITS;b++){
//         int prefix_sum = 0;

//         for(int i=0;i<N;i++){
//             int cur = query_sum(0, i, i, b);
//             //cout<<"b: "<<b<<" i: "<<i<<" cur: "<<cur<<endl;
//             prefix_sum += cur;
//             add(i, -cur + (prefix_sum > 0? 1: 0), b);
//         }
//     }
// }

int A[NUMBITS][100005];
int S[NUMBITS][100005];

int main(){
    ios_base::sync_with_stdio(0);
    int n,m;
    while(cin>>n>>m){
        CLR(A);

        vector<int> ls,rs,qs;

        for(int i=0;i<m;i++){
            int l,r,q;
            cin>>l>>r>>q;
            l--;
            r--;
            ls.push_back(l);
            rs.push_back(r);
            qs.push_back(q);

            for(int b=0;b<NUMBITS;b++){
                if((q>>b) & 1){
                    A[b][l] += 1;
                    if(r+1<n)
                        A[b][r+1] -= 1;
                }
            }
        }

        for(int b=0;b<NUMBITS;b++){
            int cur = 0;
            for(int i=0;i<n;i++){
                cur += A[b][i];
                if(cur > 0) A[b][i] = 1;
                else A[b][i] = 0;
            }
        }

        CLR(S);
        for(int b=0;b<NUMBITS;b++){
            S[b][0] = A[b][0];
            for(int i=1;i<n;i++){
                S[b][i] = S[b][i-1] + A[b][i];
            }
        }

        bool good = 1;
        for(int i=0;i<m;i++){
            for(int b=0;b<NUMBITS;b++){
                int numset = S[b][rs[i]]-((ls[i]-1<0)?0:S[b][ls[i]-1]);
                if(!((qs[i] >> b) & 1) && numset == rs[i]-ls[i]+1){
                    good = 0;
                }
            }
        }

        if(!good){
            cout<<"NO"<<endl;
        } else{
            cout<<"YES"<<endl;
            for(int i=0;i<n;i++){
                int res = 0;
                for(int b=0;b<NUMBITS;b++){
                    res |= (A[b][i] << b);
                }
                cout<<res<<" ";
            }
            cout<<endl;
        }
    }
}


#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <map>
#include <vector>
#include <set>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cctype>
#include <cmath>
#include <fstream>

using namespace std;

typedef long long ll;
#define REP(i,k) for(int (i)=0;(i)<(k);(i)++)
#define INF ~(1<<31)
#define CLR(a) memset((a),0,sizeof((a)))
#define EPS 1e-9
#define DBG 1
#define D(s,v) if(DBG) cout<<(s)<<": "<<(v)<<endl;
#define DVEC(s,v) if(DBG) {cout<<(s)<<": "; for(int i=0;i<(v).size();i++) cout<<(v)[i]<<" "; cout<<endl;}
#define DARR(s,v,n) if(DBG) {cout<<(s)<<": "; for(int i=0;i<n;i++) cout<<(v)[i]<<" "; cout<<endl;}

#define MOD 1000000007
#define NUMBITS 31

int N;
int L[32][264005], R[32][264005], V[32][264005];
int INDEX_TO_NODE[32][100005];
vector<int> a;

void build(int node, int l, int r, int bit){
    L[bit][node] = l;
    R[bit][node] = r;
    if(l==r){
        INDEX_TO_NODE[bit][l] = node;
        return;
    }
    int mid = (l+r)/2;
    build(2*node+1, l, mid, bit);
    build(2*node+2, mid+1, r, bit);
}

void build_tree(int n, int bits){
    N = n;
    CLR(L);
    CLR(R);
    CLR(V);
    CLR(INDEX_TO_NODE);

    for(int bit=0;bit<bits;bit++){
        build(0, 0, n-1, bit);
    }
}

void add(int idx, int v, int bit){
    int node = INDEX_TO_NODE[bit][idx];
    while(true){
        V[bit][node] += v;
        if(node==0) break;
        node = (node-1) / 2;
    }
}

void add_range(int l, int r, int v, int bit){
    add(l, v, bit);
    if(r+1 < N)
        add(r+1, -v, bit);
}

int query_sum(int node, int l, int r, int bit){
    //cout<<"query: "<<pos<<" L:"<<L[bit][pos]<<" R:"<<R[bit][pos]<<" l: "<<l<<" r: "<<r<<endl;
    if(R[bit][node] < l || L[bit][node] > r)
        return 0;
    else if(L[bit][node]>=l && R[bit][node]<=r)
        return V[bit][node];

    return query_sum(2*node+1, l, r, bit) +
    query_sum(2*node+2, l, r, bit);
}

void compute_prefix_sum(){
    for(int b=0;b<NUMBITS;b++){
        int prefix_sum = 0;

        for(int i=0;i<N;i++){
            int cur = query_sum(0, i, i, b);
            //cout<<"b: "<<b<<" i: "<<i<<" cur: "<<cur<<endl;
            prefix_sum += cur;
            add(i, -cur, b);
            if(prefix_sum > 0)
                add(i, 1, b);
        }
    }
}

int main(){
    int n,m;
    while(cin>>n>>m){
        build_tree(n, NUMBITS);

        vector<int> ls,rs,qs;
        for(int i=0;i<m;i++){
            int l,r,q;
            cin>>l>>r>>q;
            l--;
            r--;
            ls.push_back(l);
            rs.push_back(r);
            qs.push_back(q);
            for(int b=0;b<NUMBITS;b++){
                if((q>>b) & 1){
                    add_range(l, r, 1, b);
                }
            }
        }

        // for(int i=0;i<n;i++){
        //     for(int bit=0;bit<3;bit++)
        //         cout<<query_sum(0, i, i, bit);
        //     cout<<endl;
        // }
        // cout<<"================"<<endl;
        compute_prefix_sum();
        // for(int i=0;i<n;i++){
        //     for(int bit=0;bit<3;bit++)
        //         cout<<query_sum(0, i, i, bit);
        //     cout<<endl;
        // }

        bool good = 1;
        for(int i=0;i<m;i++){
            int l = ls[i];
            int r = rs[i];
            int q = qs[i];
            for(int b=0;b<NUMBITS;b++){
                int numset = query_sum(0,l,r,b);
                // if(((q>>b) & 1) && numset != r-l+1){
                //     cout<<"ERROR q: "<<q<<" l: "<<l<<" r:"<<r<<" b: "<<b<<" numset:"<<numset<<" expected numset: "<<(r-l+1)<<endl;
                // }
                if(!((q>>b) & 1)){
                    if(numset == r-l+1){
                        good = 0;
                    }
                }
            }
        }
        if(!good){
            cout<<"NO"<<endl;
        } else{
            cout<<"YES"<<endl;
            for(int i=0;i<n;i++){
                int res = 0;
                for(int b=0;b<NUMBITS;b++){
                    res |= (query_sum(0,i,i,b) << b);
                }
                cout<<res<<" ";
            }
            cout<<endl;
        }
    }
}


#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <map>
#include <vector>
#include <set>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cctype>
#include <cmath>
#include <fstream>

using namespace std;

typedef long long ll;
#define REP(i,k) for(int (i)=0;(i)<(k);(i)++)
#define INF ~(1<<31)
#define CLR(a) memset((a),0,sizeof((a)))
#define EPS 1e-9
#define DBG 1
#define D(s,v) if(DBG) cout<<(s)<<": "<<(v)<<endl;
#define DVEC(s,v) if(DBG) {cout<<(s)<<": "; for(int i=0;i<(v).size();i++) cout<<(v)[i]<<" "; cout<<endl;}
#define DARR(s,v,n) if(DBG) {cout<<(s)<<": "; for(int i=0;i<n;i++) cout<<(v)[i]<<" "; cout<<endl;}

#define MOD 1000000007
#define NUMBITS 31

int N;
int L[32][200005], R[32][200005], V[32][200005];
int POS[32][100005];
vector<int> a;

void build(int pos, int l, int r, int bit){
    L[bit][pos] = l;
    R[bit][pos] = r;
    if(l==r){
        POS[bit][l] = pos;
        return;
    }
    int mid = (l+r)/2;
    build(2*pos+1, l, mid, bit);
    build(2*pos+2, mid+1, r, bit);
}

void build_tree(int n, int bits){
    N = n;
    CLR(L);
    CLR(R);
    CLR(V);
    CLR(POS);

    for(int bit=0;bit<bits;bit++){
        build(0, 0, n-1, bit);
    }
}

void add(int idx, int v, int bit){
    int p = POS[bit][idx];
    while(true){
        V[bit][p] += v;
        if(p==0) break;
        p = (p-1) / 2;
    }
}

void add_range(int l, int r, int v, int bit){
    add(l, v, bit);
    if(r+1 < N)
        add(r+1, -v, bit);
}

int query(int pos, int l, int r, int bit){
    //cout<<"query: "<<pos<<" L:"<<L[bit][pos]<<" R:"<<R[bit][pos]<<" l: "<<l<<" r: "<<r<<endl;
    if(R[bit][pos] < l || L[bit][pos] > r)
        return 0;
    else if(L[bit][pos]>=l && R[bit][pos]<=r)
        return V[bit][pos];

    return query(2*pos+1, l, r, bit) +
    query(2*pos+2, l, r, bit);
}

void compute_prefix_sum(){
    for(int b=0;b<NUMBITS;b++){
        int psum = 0;

        for(int i=0;i<N;i++){
            int cur = query(0, i, i, b);
            //cout<<"b: "<<b<<" i: "<<i<<" cur: "<<cur<<endl;
            psum += cur;
            add(i, -cur, b);
            add(i, psum, b);
        }
    }
}

int main(){
    int n,m;
    while(cin>>n>>m){
        build_tree(n, NUMBITS);

        vector<int> ls,rs,qs;
        for(int i=0;i<m;i++){
            int l,r,q;
            cin>>l>>r>>q;
            l--;
            r--;
            ls.push_back(l);
            rs.push_back(r);
            qs.push_back(q);
            for(int b=0;b<NUMBITS;b++){
                if((q>>b) & 1){
                    add_range(l, r, 1, b);
                }
            }
        }
        compute_prefix_sum();

        bool good = 1;
        for(int i=0;i<m;i++){
            int l = ls[i];
            int r = rs[i];
            int q = qs[i];
            for(int b=0;b<NUMBITS;b++){
                int numset = query(0,l,r,b);
                if(!((q>>b) & 1)){
                    if(numset == r-l+1){
                        good = 0;
                    }
                }
            }
        }
        if(!good){
            cout<<"NO"<<endl;
        } else{
            cout<<"YES"<<endl;
            for(int i=0;i<n;i++){
                int res = 0;
                for(int b=0;b<NUMBITS;b++){
                    res |= (query(0,i,i,b) << b);
                }
                cout<<res<<" ";
            }
            cout<<endl;
        }
    }
}


#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <map>
#include <vector>
#include <set>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cctype>
#include <cmath>
#include <fstream>

using namespace std;

typedef long long ll;
#define REP(i,k) for(int (i)=0;(i)<(k);(i)++)
#define INF ~(1<<31)
#define CLR(a) memset((a),0,sizeof((a)))
#define EPS 1e-9
#define DBG 1
#define D(s,v) if(DBG) cout<<(s)<<": "<<(v)<<endl;
#define DVEC(s,v) if(DBG) {cout<<(s)<<": "; for(int i=0;i<(v).size();i++) cout<<(v)[i]<<" "; cout<<endl;}
#define DARR(s,v,n) if(DBG) {cout<<(s)<<": "; for(int i=0;i<n;i++) cout<<(v)[i]<<" "; cout<<endl;}

#define MOD 1000000007
#define NUMBITS 31

int N;
int L[32][264005], R[32][264005], V[32][264005];
int INDEX_TO_NODE[32][100005];
vector<int> a;

void build(int node, int l, int r, int bit){
    L[bit][node] = l;
    R[bit][node] = r;
    if(l==r){
        INDEX_TO_NODE[bit][l] = node;
        return;
    }
    int mid = (l+r)/2;
    build(2*node+1, l, mid, bit);
    build(2*node+2, mid+1, r, bit);
}

void build_tree(int n, int bits){
    N = n;
    CLR(L);
    CLR(R);
    CLR(V);
    CLR(INDEX_TO_NODE);

    for(int bit=0;bit<bits;bit++){
        build(0, 0, n-1, bit);
    }
}

void add(int idx, int v, int bit){
    int node = INDEX_TO_NODE[bit][idx];
    while(true){
        V[bit][node] += v;
        if(node==0) break;
        node = (node-1) / 2;
    }
}

void add_range(int l, int r, int v, int bit){
    add(l, v, bit);
    if(r+1 < N)
        add(r+1, -v, bit);
}

int query_sum(int node, int l, int r, int bit){
    //cout<<"query: "<<pos<<" L:"<<L[bit][pos]<<" R:"<<R[bit][pos]<<" l: "<<l<<" r: "<<r<<endl;
    if(R[bit][node] < l || L[bit][node] > r)
        return 0;
    else if(L[bit][node]>=l && R[bit][node]<=r)
        return V[bit][node];

    return query_sum(2*node+1, l, r, bit) +
    query_sum(2*node+2, l, r, bit);
}

void compute_prefix_sum(){
    for(int b=0;b<NUMBITS;b++){
        int prefix_sum = 0;

        for(int i=0;i<N;i++){
            int cur = query_sum(0, i, i, b);
            //cout<<"b: "<<b<<" i: "<<i<<" cur: "<<cur<<endl;
            prefix_sum += cur;
            add(i, -cur + (prefix_sum > 0? 1: 0), b);
        }
    }
}

int main(){
    ios_base::sync_with_stdio(0);
    int n,m;
    while(cin>>n>>m){
        build_tree(n, NUMBITS);

        vector<int> ls,rs,qs;
        for(int i=0;i<m;i++){
            int l,r,q;
            cin>>l>>r>>q;
            l--;
            r--;
            ls.push_back(l);
            rs.push_back(r);
            qs.push_back(q);
            for(int b=0;b<NUMBITS;b++){
                if((q>>b) & 1){
                    add_range(l, r, 1, b);
                }
            }
        }

        // for(int i=0;i<n;i++){
        //     for(int bit=0;bit<3;bit++)
        //         cout<<query_sum(0, i, i, bit);
        //     cout<<endl;
        // }
        // cout<<"================"<<endl;
        compute_prefix_sum();
        // for(int i=0;i<n;i++){
        //     for(int bit=0;bit<3;bit++)
        //         cout<<query_sum(0, i, i, bit);
        //     cout<<endl;
        // }

        bool good = 1;
        for(int i=0;i<m;i++){
            int l = ls[i];
            int r = rs[i];
            int q = qs[i];
            for(int b=0;b<NUMBITS;b++){
                int numset = query_sum(0,l,r,b);
                // if(((q>>b) & 1) && numset != r-l+1){
                //     cout<<"ERROR q: "<<q<<" l: "<<l<<" r:"<<r<<" b: "<<b<<" numset:"<<numset<<" expected numset: "<<(r-l+1)<<endl;
                // }
                if(!((q>>b) & 1)){
                    if(numset == r-l+1){
                        good = 0;
                    }
                }
            }
        }
        if(!good){
            cout<<"NO"<<endl;
        } else{
            cout<<"YES"<<endl;
            for(int i=0;i<n;i++){
                int res = 0;
                for(int b=0;b<NUMBITS;b++){
                    res |= (query_sum(0,i,i,b) << b);
                }
                cout<<res<<" ";
            }
            cout<<endl;
        }
    }
}


#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6;
const int MAXBIT =30;
int a[MAXN],t[4*MAXN];
void build(int v, int tl, int tr){
	if(tl==tr)
		t[v]=a[tl];
	else{
		int tm = (tl+tr)/2;
		build(v*2,tl,tm);
		build(v*2+1,tm+1,tr);
		//depende la operación a realizar.
		t[v]=t[v*2]&t[v*2+1];
	}
}
int get(int v, int tl, int tr, int l, int r){
	if(l>r)
		//retornar valor neutro de la opéración.
		return (1ll<<MAXBIT)-1;
	if(tl==l&&tr==r)
		return t[v];
	int tm = (tl+tr)/2;
	return get(v*2,tl,tm,l,min(r,tm))&get(v*2,tm+1,tl,max(tm+1,l),r);

}
void update(int v,int tl, int tr, int pos, int new_val){
	if(tl==tr)
		t[v]=new_val;
	else{
		int tm  = (tl+tr)/2;
		if(pos<=tm)
			update(v*2,tl,tm,pos,new_val);
		else
			update(v*2+1,tm+1,tr,pos,new_val);
		t[v]=t[v*2]+t[v*2+1];
	}
}
int l[MAXN],r[MAXN],q[MAXN],sum[MAXN];
int n,m;
int main(){
	scanf("%d%d",&n,&m);
	for(int i=0; i<m ; i++){
		scanf("%d%d%d",l+i,r+i,q+i);
		l[i]--;
	}
	for(int bit = 0; bit<=MAXBIT; bit++){
		for(int i =0; i<n; i++)sum[i]=0;
		for(int i = 0; i<m; i++){
			if((q[i]>>bit)&1){
				sum[l[i]]++;
				sum[r[i]]--;
			}
		}
		for(int i=0; i<n; i++){
			if(i>0) sum[i]+=sum[i-1];
			if(sum[i]>0){
				a[i]|=(1<<bit);
			}
		}

	}
	build(1,0,n-1);
	for(int i = 0; i<m; i++){
		if(get(1,0,n-1,l[i],r[i]-1)!=q[i]){
			printf("NO\n");
			return 0;
		}
	}
	printf("YES\n");
	for(int i=0; i<n; i++){
		if(i)printf(" ");
		printf("%d",a[i]);
	}
	return 0;

}


#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1000*1000;
const long long MAXBIT =30;
long long a[MAXN],t[4*MAXN];
void build(long long v, long long tl, long long tr){
	if(tl==tr)
		t[v]=a[tl];
	else{
		long long tm = (tl+tr)/2;
		build(v*2,tl,tm);
		build(v*2+1,tm+1,tr);
		//depende la operación a realizar.
		t[v]=t[v*2]&t[v*2+1];
	}
}
long long get(long long v, long long tl, long long tr, long long l, long long r){
	if(l>r)
		//retornar valor neutro de la opéración.
		return (1LL<<MAXBIT)-1;
	if(tl==l&&tr==r)
		return t[v];
	long long tm = (tl+tr)/2;
	long long ans = (1LL<<MAXBIT)-1;
	ans&=get(v*2,tl,tm,l,min(r,tm));
	ans&=get(v*2,tm+1,tl,max(tm+1,l),r);
	return ans;
}
void update(long long v,long long tl, long long tr, long long pos, long long new_val){
	if(tl==tr)
		t[v]=new_val;
	else{
		long long tm  = (tl+tr)/2;
		if(pos<=tm)
			update(v*2,tl,tm,pos,new_val);
		else
			update(v*2+1,tm+1,tr,pos,new_val);
		t[v]=t[v*2]+t[v*2+1];
	}
}
long long l[MAXN],r[MAXN],q[MAXN],sum[MAXN];
long long n,m;
int main(){
	scanf("%lld%lld",&n,&m);
	for(long long i=0; i<m ; i++){
		scanf("%lld%lld%lld",l+i,r+i,q+i);
		l[i]--;
	}
	for(long long bit = 0; bit<=MAXBIT; bit++){
		for(long long i =0; i<n; i++)sum[i]=0;
		for(long long i = 0; i<m; i++){
			if((q[i]>>bit)&1){
				sum[l[i]]++;
				sum[r[i]]--;
			}
		}
		for(long long i=0; i<n; i++){
			if(i>0) sum[i]+=sum[i-1];
			if(sum[i]>0){
				a[i]|=(1<<bit);
			}
		}

	}
	build(1,0,n-1);
	for(long long i = 0; i<m; i++){
		if(get(1,0,n-1,l[i],r[i]-1)!=q[i]){
			printf("NO\n");
			return 0;
		}
	}
	printf("YES\n");
	for(long long i=0; i<n; i++){
		if(i)printf(" ");
		printf("%lld",a[i]);
	}
	return 0;

}


#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6;
const int MAXBIT =30;
int a[MAXN],t[4*MAXN];
void build(int v, int tl, int tr){
	if(tl==tr)
		t[v]=a[tl];
	else{
		int tm = (tl+tr)/2;
		build(v*2,tl,tm);
		build(v*2+1,tm+1,tr);
		//depende la operación a realizar.
		t[v]=t[v*2]&t[v*2+1];
	}
}
int get(int v, int tl, int tr, int l, int r){
	if(l>r)
		//retornar valor neutro de la opéración.
		return (1LL<<MAXBIT)-1;
	if(tl==l&&tr==r)
		return t[v];
	int tm = (tl+tr)/2;
	int ans = (1LL<<MAXBIT)-1;
	ans&=get(v*2,tl,tm,l,min(r,tm));
	ans&=get(v*2,tm+1,tl,max(tm+1,l),r);
	return ans;
}
void update(int v,int tl, int tr, int pos, int new_val){
	if(tl==tr)
		t[v]=new_val;
	else{
		int tm  = (tl+tr)/2;
		if(pos<=tm)
			update(v*2,tl,tm,pos,new_val);
		else
			update(v*2+1,tm+1,tr,pos,new_val);
		t[v]=t[v*2]+t[v*2+1];
	}
}
int l[MAXN],r[MAXN],q[MAXN],sum[MAXN];
int n,m;
int main(){
	scanf("%d%d",&n,&m);
	for(int i=0; i<m ; i++){
		scanf("%d%d%d",l+i,r+i,q+i);
		l[i]--;
	}
	for(int bit = 0; bit<=MAXBIT; bit++){
		for(int i =0; i<n; i++)sum[i]=0;
		for(int i = 0; i<m; i++){
			if((q[i]>>bit)&1){
				sum[l[i]]++;
				sum[r[i]]--;
			}
		}
		for(int i=0; i<n; i++){
			if(i>0) sum[i]+=sum[i-1];
			if(sum[i]>0){
				a[i]|=(1<<bit);
			}
		}

	}
	build(1,0,n-1);
	for(int i = 0; i<m; i++){
		if(get(1,0,n-1,l[i],r[i]-1)!=q[i]){
			printf("NO\n");
			return 0;
		}
	}
	printf("YES\n");
	for(int i=0; i<n; i++){
		if(i)printf(" ");
		printf("%d",a[i]);
	}
	return 0;

}


#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1000*1000;
const long long MAXBIT =30;
long long a[MAXN],t[4*MAXN];
void build(long long v, long long tl, long long tr){
	if(tl==tr)
		t[v]=a[tl];
	else{
		long long tm = (tl+tr)/2;
		build(v*2,tl,tm);
		build(v*2+1,tm+1,tr);
		//depende la operación a realizar.
		t[v]=t[v*2]&t[v*2+1];
	}
}
long long get(long long v, long long tl, long long tr, long long l, long long r){
	if(l>r)
		//retornar valor neutro de la opéración.
		return (1LL<<MAXBIT)-1;
	if(tl==l&&tr==r)
		return t[v];
	long long tm = (tl+tr)/2;
	long long ans = (1LL<<MAXBIT)-1;
	ans&=get(v*2,tl,tm,l,min(r,tm));
	ans&=get(v*2,tm+1,tl,max(tm+1,l),r);
	return ans;
}
long long ll[MAXN],rr[MAXN],q[MAXN],sum[MAXN];
long long n,m;
int main(){
	scanf("%lld%lld",&n,&m);
	for(long long i=0; i<m ; i++){
		scanf("%lld%lld%lld",ll+i,rr+i,q+i);
		ll[i]--;
	}
	for(long long bit = 0; bit<=MAXBIT; bit++){
		for(long long i =0; i<n; i++)sum[i]=0;
		for(long long i = 0; i<m; i++){
			if((q[i]>>bit)&1LL){
				sum[ll[i]]++;
				sum[rr[i]]--;
			}
		}
		for(long long i=0; i<n; i++){
			if(i>0) sum[i]+=sum[i-1];
			if(sum[i]>0){
				a[i]|=(1<<bit);
			}
		}

	}
	build(1,0,n-1);
	for(long long i = 0; i<m; i++){
		if(get(1,0,n-1,ll[i],rr[i]-1)!=q[i]){
			printf("NO\n");
			return 0;
		}
	}
	printf("YES\n");
	for(long long i=0; i<n; i++){
		if(i)printf(" ");
		printf("%lld",a[i]);
	}
	return 0;

}


#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5+5;
const int MAXBIT =30;
int a[MAXN],t[4*MAXN];
void build(int v, int tl, int tr){
	if(tl==tr)
		t[v]=a[tl];
	else{
		int tm = (tl+tr)/2;
		build(v*2,tl,tm);
		build(v*2+1,tm+1,tr);
		//depende la operación a realizar.
		t[v]=t[v*2]&t[v*2+1];
	}
}
int get(int v, int tl, int tr, int l, int r){
	if(l>r)
		//retornar valor neutro de la opéración.
		return (1ll<<MAXBIT)-1;
	if(tl==l&&tr==r)
		return t[v];
	int tm = (tl+tr)/2;
	return get(v*2,tl,tm,l,min(r,tm))&get(v*2,tm+1,tl,max(tm+1,l),r);

}
void update(int v,int tl, int tr, int pos, int new_val){
	if(tl==tr)
		t[v]=new_val;
	else{
		int tm  = (tl+tr)/2;
		if(pos<=tm)
			update(v*2,tl,tm,pos,new_val);
		else
			update(v*2+1,tm+1,tr,pos,new_val);
		t[v]=t[v*2]+t[v*2+1];
	}
}
int l[MAXN],r[MAXN],q[MAXN],sum[MAXN];
int n,m;
int main(){
	scanf("%d%d",&n,&m);
	for(int i=0; i<m ; i++){
		scanf("%d%d%d",l+i,r+i,q+i);
		l[i]--;
	}
	for(int bit = 0; bit<=MAXBIT; bit++){
		for(int i =0; i<n; i++)sum[i]=0;
		for(int i = 0; i<m; i++){
			if((q[i]>>bit)&1){
				sum[l[i]]++;
				sum[r[i]]--;
			}
		}
		for(int i=0; i<n; i++){
			if(i>0) sum[i]+=sum[i-1];
			if(sum[i]>0){
				a[i]|=(1<<bit);
			}
		}

	}
	build(1,0,n-1);
	for(int i = 0; i<m; i++){
		if(get(1,0,n-1,l[i],r[i]-1)!=q[i]){
			printf("NO\n");
			return 0;
		}
	}
	printf("YES\n");
	for(int i=0; i<n; i++){
		if(i)printf(" ");
		printf("%d",a[i]);
	}
	return 0;

}


#include <cstdio>
#include <algorithm>

const int N = 1000 * 1000;
const int MAXBIT = 30;
int l[N], r[N], q[N], a[N], t[4 * N];
int sum[N];

inline void build(int v, int l, int r) {
 	if (l + 1 == r) {
 	 	t[v] = a[l];
 	 	return;
 	}

 	int mid = (l + r) >> 1;
	build(v * 2, l, mid);
	build(v * 2 + 1, mid, r);

	t[v] = t[v * 2] & t[v * 2 + 1];
}

inline int query(int v, int l, int r, int L, int R) {
 	if (l == L && r == R) {
 	 	return t[v];
 	}
 	int mid = (L + R) >> 1;
 	int ans = (1ll << MAXBIT) - 1;

 	if (l < mid)
 		ans &= query(v * 2, l, std::min(r, mid), L, mid);
 	if (mid < r)
 		ans &= query(v * 2 + 1, std::max(l, mid), r, mid, R);

 	return ans;
}

int main() {
	int n, m;
	scanf("%d %d\n", &n, &m);

	for(int i = 0; i < m; i++) {
	 	scanf("%d %d %d\n", &l[i], &r[i], &q[i]);
		l[i]--;
	}

	for(int bit = 0; bit <= MAXBIT; bit++) {
		for(int i = 0; i < n; i++) sum[i] = 0;
		for(int i = 0; i < m; i++) {
			if ((q[i] >> bit) & 1) {
				sum[l[i]]++;
				sum[r[i]]--;
	 		}
	 	}
	 	for(int i = 0; i < n; i++) {
	 	 	if (i > 0) sum[i] += sum[i - 1];

	 	 	if (sum[i] > 0) {
	 	 	 	a[i] |= (1 << bit);
	 	 	}
	 	}
	}

	build(1, 0, n);

	for(int i = 0; i < m; i++) {
		if (query(1, l[i], r[i], 0, n) != q[i]) {
			puts("NO");
			return 0;
	 	}
	}

	puts("YES");
	for(int i = 0; i < n; i++) {
		if (i) printf(" ");
		printf("%d", a[i]);
	}
	puts("");
}


///#include <stdio.h>
///#include <iostream>
///#include <cstring>
///#include <cmath>
///#include <algorithm>
///#include <string>
///#include <vector>
///#include <map>
///#include <set>
///#include <queue>
///#include <cstdlib>
///#include <limits>
///#include <iostream>
///#include <sstream>
///#include <unordered_set>
///#include <unordered_map>
///#include <random>
#include <bits/stdc++.h>
///#include <bits/stdtr1c++.h>
///#include <ext/pb_ds/assoc_container.hpp>
///#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
///using namespace __gnu_pbds;
#define              MAX             100005
#define              EPS             1e-9
#define              ull             unsigned long long
#define              ll              long long
#define              inf             INT_MAX
#define              pi              acos(-1.0)
#define              vi              vector<int>
#define              vl              vector<long long>
#define              pii             pair<int,int>
#define              pll             pair<long long,long long>
#define              mp              make_pair
#define              mem(a, v)       memset(a, v, sizeof (a))
#define              mod             1000000007
#define              all(a)          a.begin(),a.end()
#define              rall(a)         a.rbegin(),a.rend()
#define              ff              first
#define              ss              second
#define              arsort(ar,n)    sort(ar,ar+n);
#define              vsort(v)        sort(v.begin(),v.end())
#define              vrev(v)         reverse(v.begin(),v.end())
#define              arrev(ar,n)     reverse(ar,ar+n)
#define              pb              push_back
#define              popb            pop_back
#define              booster()       ios_base::sync_with_stdio(0); cin.tie(0);
#define              read(f)         freopen(f, "r", stdin)
#define              scani(x)        scanf("%d",&x)
#define              scanl(x)        scanf("%I64d",&x)
#define              scand(x)        scanf("%lf",&x)
#define              scans(x)        scanf("%s",x)
#define              min3(a,b,c)     min(a,min(b,c))
#define              max3(a,b,c)     max(a,max(b,c))
#define              min4(a,b,c,d)   min(min(a,b),min(c,d))
#define              max4(a,b,c,d)   max(max(a,b),max(c,d))
#define              max5(a,b,c,d,e) max(max3(a,b,c),max(d,e))
#define              min5(a,b,c,d,e) min(min3(a,b,c),min(d,e))

#define              bitCheck(a,k)     ((bool)(a&(1<<(k))))
#define              bitOff(a,k)       (a&(~(1<<(k))))
#define              bitOn(a,k)        (a|(1<<(k)))
#define              bitFlip(a,k)      (a^(1<<(k)))

#define              POPCOUNT           __builtin_popcount
#define              POPCOUNTLL         __builtin_popcountll
#define              RIGHTMOST          __builtin_ctzll
#define              LEFTMOST(x)        (63-__builtin_clzll((x)))
#define              piii               pair<pii,int>

#define scani2(a,b) scani(a) , scani(b)
#define scani3(a,b,c) scani(a), scani(b), scani(c)
#define scani4(a,b,c,d) scani(a), scani(b), scani(c), scani(d)
#define scani5(a,b,c,d,e) scani(a), scani(b), scani(c), scani(d) , scani(e)
#define rnd mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

/*********************Ordered Multiset*************************/

/*** Needs C++11 or C++14 ***/
/// Treap supporting duplicating values in set
/// Maximum value of treap * ADD must fit in long long

/**

struct Treap{ /// hash = 96814
    int len;
    const int ADD = 1000010;
    const int MAXVAL = 1000000010;
    tr1::unordered_map <long long, int> mp; /// Change to int if only int in treap
    tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> T;
    Treap(){
        len = 0;
        T.clear(), mp.clear();
    }
    inline void clear(){
        len = 0;
        T.clear(), mp.clear();
    }
    inline void insert(long long x){
        len++, x += MAXVAL;
        int c = mp[x]++;
        T.insert((x * ADD) + c);
    }
    inline void erase(long long x){
        x += MAXVAL;
        int c = mp[x];
        if (c){
            c--, mp[x]--, len--;
            T.erase((x * ADD) + c);
        }
    }
    /// 1-based index, returns the K'th element in the treap, -1 if none exists
    inline long long kth(int k){
        if (k < 1 || k > len) return -1;
        auto it = T.find_by_order(--k);
        return ((*it) / ADD) - MAXVAL;
    }
    /// Count of value < x in treap
    inline int count(long long x){
        x += MAXVAL;
        int c = mp[--x];
        return (T.order_of_key((x * ADD) + c));
    }
    /// Number of elements in treap
    inline int size(){
        return len;
    }
};

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;///*X.find_by_order();X.order_of_key();**/
template <class T> inline bool isLeap(T y) {return (y % 400 == 0) || (y % 100 ? y % 4 == 0 : false); }
template< class T > inline T gcd(T a, T b) { return (b) == 0 ? (a) : gcd((b), ((a) % (b))); }
template< class T > inline T lcm(T a, T b) { return ((a) / gcd((a), (b)) * (b)); }
template <class T> inline T BigMod(T Base,T power,T M=mod){if(power==0)return 1;if(power&1)return ((Base%M)*(BigMod(Base,power-1,M)%M))%M;else{T y=BigMod(Base,power/2,M)%M;return (y*y)%M;}}
template <class T> inline T ModInv (T A,T M = mod){return BigMod(A,M-2,M);}

int fx[] = {-1,+0,+1,+0,+1,+1,-1,-1,+0};
int fy[] = {+0,-1,+0,+1,+1,-1,+1,-1,+0};
int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

/*********************** let the play begin() ***********************************/

int arr[MAX][42];int v2[45][5];vector<piii>vv;vi vanu[MAX];

bool cmp(const piii &a,const piii &b)
{
    if(a.ff.ff==b.ff.ff)return a.ff.ss<b.ff.ss;
    return a.ff.ff<b.ff.ff;
}

int main()
{
    booster()
    ///read("input.txt");
    int flag = 0;
    for(int i = 0;i<MAX;i++)
    {
        for(int j = 0;j<=40;j++)arr[i][j] = -1;
    }
    for(int i = 0;i<=41;i++)
    {
        v2[i][0] = -1;
        v2[i][1] = -1;
    }
    int n,m;
    cin>>n>>m;
    for(int i = 0;i<m;i++)
    {
        int a,b,q;
        cin>>a>>b>>q;
        vv.pb(piii(pii(a,b),q));
    }
    sort(all(vv),cmp);
    for(int j = 0;j<m;j++)
    {
       int l = vv[j].ff.ff;
       int r = vv[j].ff.ss;

       int q = vv[j].ss;

        vi v;
        while(q)
        {
            v.pb(q%2);
            q/=2;
        }
        while(v.size()<30)v.pb(0);
        reverse(all(v));
       /// for(auto jj : v)cout<<jj;
       /// cout<<endl;
        for(int i = 0;i<30;i++)
        {
            int x = v[i];
            if(x==0)
            {
                if(v2[i][1]>=r)flag = 1;
                else if(v2[i][1]>=l&&v2[i][1]<r)
                {
                    arr[v2[i][1]+1][i] = 0;
                    vanu[i].pb(v2[i][1]+1);
                }
                else {
                    arr[l][i] = 0;
                    vanu[i].pb(l);
                }
            }
            else
            {
                sort(vanu[i].begin(),vanu[i].end());
                int x = lower_bound(all(vanu[i]),l)-vanu[i].begin();
                if(x!=vanu[i].size()&&vanu[i][x]<=r)
                {
                    flag = 1;
                }
                else
                {
                    v2[i][1] = max(v2[i][1],r);
                }
            }

            ///cout<<x<<" "<<v2[i][0]<<" "<<v2[i][1]<<endl;

        }

    }
    if(flag)
    {
        cout<<"NO";
        return 0;
    }
    else cout<<"YES"<<endl;

    for(int i = 0;i<n;i++)
    {
        ll pt = 1,ans = 0;
        for(int j = 29;j>=0;j--)
        {
            ///cout<<arr[i+1][j]<<" ";
            if(arr[i+1][j]!=0)ans+=pt;
            pt = pt*2;
        }
        ///cout<<endl;
        cout<<ans<<" ";

    }

    return 0;
}


///#include <stdio.h>
///#include <iostream>
///#include <cstring>
///#include <cmath>
///#include <algorithm>
///#include <string>
///#include <vector>
///#include <map>
///#include <set>
///#include <queue>
///#include <cstdlib>
///#include <limits>
///#include <iostream>
///#include <sstream>
///#include <unordered_set>
///#include <unordered_map>
///#include <random>
#include <bits/stdc++.h>
///#include <bits/stdtr1c++.h>
///#include <ext/pb_ds/assoc_container.hpp>
///#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
///using namespace __gnu_pbds;
#define              MAX             100005
#define              EPS             1e-9
#define              ull             unsigned long long
#define              ll              long long
#define              inf             INT_MAX
#define              pi              acos(-1.0)
#define              vi              vector<int>
#define              vl              vector<long long>
#define              pii             pair<int,int>
#define              pll             pair<long long,long long>
#define              mp              make_pair
#define              mem(a, v)       memset(a, v, sizeof (a))
#define              mod             1000000007
#define              all(a)          a.begin(),a.end()
#define              rall(a)         a.rbegin(),a.rend()
#define              ff              first
#define              ss              second
#define              arsort(ar,n)    sort(ar,ar+n);
#define              vsort(v)        sort(v.begin(),v.end())
#define              vrev(v)         reverse(v.begin(),v.end())
#define              arrev(ar,n)     reverse(ar,ar+n)
#define              pb              push_back
#define              popb            pop_back
#define              booster()       ios_base::sync_with_stdio(0); cin.tie(0);
#define              read(f)         freopen(f, "r", stdin)
#define              scani(x)        scanf("%d",&x)
#define              scanl(x)        scanf("%I64d",&x)
#define              scand(x)        scanf("%lf",&x)
#define              scans(x)        scanf("%s",x)
#define              min3(a,b,c)     min(a,min(b,c))
#define              max3(a,b,c)     max(a,max(b,c))
#define              min4(a,b,c,d)   min(min(a,b),min(c,d))
#define              max4(a,b,c,d)   max(max(a,b),max(c,d))
#define              max5(a,b,c,d,e) max(max3(a,b,c),max(d,e))
#define              min5(a,b,c,d,e) min(min3(a,b,c),min(d,e))

#define              bitCheck(a,k)     ((bool)(a&(1<<(k))))
#define              bitOff(a,k)       (a&(~(1<<(k))))
#define              bitOn(a,k)        (a|(1<<(k)))
#define              bitFlip(a,k)      (a^(1<<(k)))

#define              POPCOUNT           __builtin_popcount
#define              POPCOUNTLL         __builtin_popcountll
#define              RIGHTMOST          __builtin_ctzll
#define              LEFTMOST(x)        (63-__builtin_clzll((x)))
#define              piii               pair<pii,int>

#define scani2(a,b) scani(a) , scani(b)
#define scani3(a,b,c) scani(a), scani(b), scani(c)
#define scani4(a,b,c,d) scani(a), scani(b), scani(c), scani(d)
#define scani5(a,b,c,d,e) scani(a), scani(b), scani(c), scani(d) , scani(e)
#define rnd mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

/*********************Ordered Multiset*************************/

/*** Needs C++11 or C++14 ***/
/// Treap supporting duplicating values in set
/// Maximum value of treap * ADD must fit in long long

/**

struct Treap{ /// hash = 96814
    int len;
    const int ADD = 1000010;
    const int MAXVAL = 1000000010;
    tr1::unordered_map <long long, int> mp; /// Change to int if only int in treap
    tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> T;
    Treap(){
        len = 0;
        T.clear(), mp.clear();
    }
    inline void clear(){
        len = 0;
        T.clear(), mp.clear();
    }
    inline void insert(long long x){
        len++, x += MAXVAL;
        int c = mp[x]++;
        T.insert((x * ADD) + c);
    }
    inline void erase(long long x){
        x += MAXVAL;
        int c = mp[x];
        if (c){
            c--, mp[x]--, len--;
            T.erase((x * ADD) + c);
        }
    }
    /// 1-based index, returns the K'th element in the treap, -1 if none exists
    inline long long kth(int k){
        if (k < 1 || k > len) return -1;
        auto it = T.find_by_order(--k);
        return ((*it) / ADD) - MAXVAL;
    }
    /// Count of value < x in treap
    inline int count(long long x){
        x += MAXVAL;
        int c = mp[--x];
        return (T.order_of_key((x * ADD) + c));
    }
    /// Number of elements in treap
    inline int size(){
        return len;
    }
};

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;///*X.find_by_order();X.order_of_key();**/
template <class T> inline bool isLeap(T y) {return (y % 400 == 0) || (y % 100 ? y % 4 == 0 : false); }
template< class T > inline T gcd(T a, T b) { return (b) == 0 ? (a) : gcd((b), ((a) % (b))); }
template< class T > inline T lcm(T a, T b) { return ((a) / gcd((a), (b)) * (b)); }
template <class T> inline T BigMod(T Base,T power,T M=mod){if(power==0)return 1;if(power&1)return ((Base%M)*(BigMod(Base,power-1,M)%M))%M;else{T y=BigMod(Base,power/2,M)%M;return (y*y)%M;}}
template <class T> inline T ModInv (T A,T M = mod){return BigMod(A,M-2,M);}

int fx[] = {-1,+0,+1,+0,+1,+1,-1,-1,+0};
int fy[] = {+0,-1,+0,+1,+1,-1,+1,-1,+0};
int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

/*********************** let the play begin() ***********************************/

int arr[MAX][42];int v2[45][5];vector<piii>vv;

bool cmp(const piii &a,const piii &b)
{
    if(a.ff.ff==b.ff.ff)return a.ff.ss<b.ff.ss;
    return a.ff.ff<b.ff.ff;
}

int main()
{
    booster()
    ///read("input.txt");
    int flag = 0;
    for(int i = 0;i<MAX;i++)
    {
        for(int j = 0;j<=40;j++)arr[i][j] = -1;
    }
    for(int i = 0;i<=41;i++)
    {
        v2[i][0] = -1;
        v2[i][1] = -1;
    }
    int n,m;
    cin>>n>>m;
    for(int i = 0;i<m;i++)
    {
        int a,b,q;
        cin>>a>>b>>q;
        vv.pb(piii(pii(a,b),q));
    }
    sort(all(vv),cmp);
    for(int j = 0;j<m;j++)
    {
       int l = vv[j].ff.ff;
       int r = vv[j].ff.ss;

       int q = vv[j].ss;

        vi v;
        while(q)
        {
            v.pb(q%2);
            q/=2;
        }
        while(v.size()<30)v.pb(0);
        reverse(all(v));
       /// for(auto jj : v)cout<<jj;
       /// cout<<endl;
        for(int i = 0;i<30;i++)
        {
            int x = v[i];
            if(x==0)
            {
                if(v2[i][1]>=r)flag = 1;
                else if(v2[i][1]>=l&&v2[i][1]<r)
                {
                    arr[v2[i][1]+1][i] = 0;
                    v2[i][0] = max(v2[i][0],v2[i][1]+1);
                }
                else {
                    arr[l][i] = 0;
                    v2[i][0] = max(v2[i][0],l);
                }
            }
            else
            {
                if(v2[i][0]>=l)flag = 1;
                else
                {
                    v2[i][1] = max(v2[i][1],r);
                }
            }

            ///cout<<x<<" "<<v2[i][0]<<" "<<v2[i][1]<<endl;

        }

    }
    if(flag)
    {
        cout<<"NO";
        return 0;
    }
    else cout<<"YES"<<endl;

    for(int i = 0;i<n;i++)
    {
        ll pt = 1,ans = 0;
        for(int j = 29;j>=0;j--)
        {
            ///cout<<arr[i+1][j]<<" ";
            if(arr[i+1][j]!=0)ans+=pt;
            pt = pt*2;
        }
        ///cout<<endl;
        cout<<ans<<" ";

    }

    return 0;
}


///#include <stdio.h>
///#include <iostream>
///#include <cstring>
///#include <cmath>
///#include <algorithm>
///#include <string>
///#include <vector>
///#include <map>
///#include <set>
///#include <queue>
///#include <cstdlib>
///#include <limits>
///#include <iostream>
///#include <sstream>
///#include <unordered_set>
///#include <unordered_map>
///#include <random>
#include <bits/stdc++.h>
///#include <bits/stdtr1c++.h>
///#include <ext/pb_ds/assoc_container.hpp>
///#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
///using namespace __gnu_pbds;
#define              MAX             100005
#define              EPS             1e-9
#define              ull             unsigned long long
#define              ll              long long
#define              inf             INT_MAX
#define              pi              acos(-1.0)
#define              vi              vector<int>
#define              vl              vector<long long>
#define              pii             pair<int,int>
#define              pll             pair<long long,long long>
#define              mp              make_pair
#define              mem(a, v)       memset(a, v, sizeof (a))
#define              mod             1000000007
#define              all(a)          a.begin(),a.end()
#define              rall(a)         a.rbegin(),a.rend()
#define              ff              first
#define              ss              second
#define              arsort(ar,n)    sort(ar,ar+n);
#define              vsort(v)        sort(v.begin(),v.end())
#define              vrev(v)         reverse(v.begin(),v.end())
#define              arrev(ar,n)     reverse(ar,ar+n)
#define              pb              push_back
#define              popb            pop_back
#define              booster()       ios_base::sync_with_stdio(0); cin.tie(0);
#define              read(f)         freopen(f, "r", stdin)
#define              scani(x)        scanf("%d",&x)
#define              scanl(x)        scanf("%I64d",&x)
#define              scand(x)        scanf("%lf",&x)
#define              scans(x)        scanf("%s",x)
#define              min3(a,b,c)     min(a,min(b,c))
#define              max3(a,b,c)     max(a,max(b,c))
#define              min4(a,b,c,d)   min(min(a,b),min(c,d))
#define              max4(a,b,c,d)   max(max(a,b),max(c,d))
#define              max5(a,b,c,d,e) max(max3(a,b,c),max(d,e))
#define              min5(a,b,c,d,e) min(min3(a,b,c),min(d,e))

#define              bitCheck(a,k)     ((bool)(a&(1<<(k))))
#define              bitOff(a,k)       (a&(~(1<<(k))))
#define              bitOn(a,k)        (a|(1<<(k)))
#define              bitFlip(a,k)      (a^(1<<(k)))

#define              POPCOUNT           __builtin_popcount
#define              POPCOUNTLL         __builtin_popcountll
#define              RIGHTMOST          __builtin_ctzll
#define              LEFTMOST(x)        (63-__builtin_clzll((x)))
#define              piii               pair<pii,int>
#define              BIT                29

#define scani2(a,b) scani(a) , scani(b)
#define scani3(a,b,c) scani(a), scani(b), scani(c)
#define scani4(a,b,c,d) scani(a), scani(b), scani(c), scani(d)
#define scani5(a,b,c,d,e) scani(a), scani(b), scani(c), scani(d) , scani(e)
#define rnd mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

/*********************Ordered Multiset*************************/

/*** Needs C++11 or C++14 ***/
/// Treap supporting duplicating values in set
/// Maximum value of treap * ADD must fit in long long

/**

struct Treap{ /// hash = 96814
    int len;
    const int ADD = 1000010;
    const int MAXVAL = 1000000010;
    tr1::unordered_map <long long, int> mp; /// Change to int if only int in treap
    tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> T;
    Treap(){
        len = 0;
        T.clear(), mp.clear();
    }
    inline void clear(){
        len = 0;
        T.clear(), mp.clear();
    }
    inline void insert(long long x){
        len++, x += MAXVAL;
        int c = mp[x]++;
        T.insert((x * ADD) + c);
    }
    inline void erase(long long x){
        x += MAXVAL;
        int c = mp[x];
        if (c){
            c--, mp[x]--, len--;
            T.erase((x * ADD) + c);
        }
    }
    /// 1-based index, returns the K'th element in the treap, -1 if none exists
    inline long long kth(int k){
        if (k < 1 || k > len) return -1;
        auto it = T.find_by_order(--k);
        return ((*it) / ADD) - MAXVAL;
    }
    /// Count of value < x in treap
    inline int count(long long x){
        x += MAXVAL;
        int c = mp[--x];
        return (T.order_of_key((x * ADD) + c));
    }
    /// Number of elements in treap
    inline int size(){
        return len;
    }
};

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;///*X.find_by_order();X.order_of_key();**/
template <class T> inline bool isLeap(T y) {return (y % 400 == 0) || (y % 100 ? y % 4 == 0 : false); }
template< class T > inline T gcd(T a, T b) { return (b) == 0 ? (a) : gcd((b), ((a) % (b))); }
template< class T > inline T lcm(T a, T b) { return ((a) / gcd((a), (b)) * (b)); }
template <class T> inline T BigMod(T Base,T power,T M=mod){if(power==0)return 1;if(power&1)return ((Base%M)*(BigMod(Base,power-1,M)%M))%M;else{T y=BigMod(Base,power/2,M)%M;return (y*y)%M;}}
template <class T> inline T ModInv (T A,T M = mod){return BigMod(A,M-2,M);}

int fx[] = {-1,+0,+1,+0,+1,+1,-1,-1,+0};
int fy[] = {+0,-1,+0,+1,+1,-1,+1,-1,+0};
int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

/*********************** let the play begin() ***********************************/

int l[MAX],r[MAX],q[MAX],a[MAX],sum[MAX],tree[5*MAX];

void Build(int node,int b,int e)
{
    if(b==e)
    {
        tree[node] = a[b];
        return ;
    }
    int mid = (b+e)>>1;
    int left = 2*node;
    int right = left+1;
    Build(left,b,mid);
    Build(right,mid+1,e);
    tree[node] = tree[left]&tree[right];
}

int query(int node,int b,int e,int l,int r)
{
    if(b>r||l>e)return (1<<30)-1;
    if(b>=l&&e<=r)return tree[node];
    int mid = (b+e)>>1;
    int left = 2*node;
    int right = left+1;
    int p1 = query(left,b,mid,l,r);
    int p2 = query(right,mid+1,e,l,r);
    return p1&p2;
}

int main()
{
    booster()
    ///read("input.txt");
    int n,m;
    cin>>n>>m;
    for(int i = 1;i<=m;i++)
    {
        cin>>l[i]>>r[i]>>q[i];
    }
    for(int i = 0;i<=BIT;i++)
    {
        for(int j = 1;j<=n;j++)sum[j] = 0;
        for(int j = 1;j<=m;j++)
        {
            if(bitCheck(q[j],i))
            {
                sum[l[j]]++;
                sum[r[j]+1]--;
            }
        }
        for(int j = 1;j<=n;j++)
        {
            sum[j] += sum[j-1];
            if(sum[j])a[j] = bitOn(a[j],i);
        }
    }

    Build(1,1,n);

    for(int i = 1;i<=m;i++)
    {
        if(query(1,1,n,l[i],r[i])!=q[i])
        {
            cout<<"NO";
            return 0;
        }
    }
    cout<<"YES"<<endl;
    for(int i = 1;i<=n;i++)cout<<a[i]<<" ";

    return 0;
}


///#include <stdio.h>
///#include <iostream>
///#include <cstring>
///#include <cmath>
///#include <algorithm>
///#include <string>
///#include <vector>
///#include <map>
///#include <set>
///#include <queue>
///#include <cstdlib>
///#include <limits>
///#include <iostream>
///#include <sstream>
///#include <unordered_set>
///#include <unordered_map>
///#include <random>
#include <bits/stdc++.h>
///#include <bits/stdtr1c++.h>
///#include <ext/pb_ds/assoc_container.hpp>
///#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
///using namespace __gnu_pbds;
#define              MAX             100005
#define              EPS             1e-9
#define              ull             unsigned long long
#define              ll              long long
#define              inf             INT_MAX
#define              pi              acos(-1.0)
#define              vi              vector<int>
#define              vl              vector<long long>
#define              pii             pair<int,int>
#define              pll             pair<long long,long long>
#define              mp              make_pair
#define              mem(a, v)       memset(a, v, sizeof (a))
#define              mod             1000000007
#define              all(a)          a.begin(),a.end()
#define              rall(a)         a.rbegin(),a.rend()
#define              ff              first
#define              ss              second
#define              arsort(ar,n)    sort(ar,ar+n);
#define              vsort(v)        sort(v.begin(),v.end())
#define              vrev(v)         reverse(v.begin(),v.end())
#define              arrev(ar,n)     reverse(ar,ar+n)
#define              pb              push_back
#define              popb            pop_back
#define              booster()       ios_base::sync_with_stdio(0); cin.tie(0);
#define              read(f)         freopen(f, "r", stdin)
#define              scani(x)        scanf("%d",&x)
#define              scanl(x)        scanf("%I64d",&x)
#define              scand(x)        scanf("%lf",&x)
#define              scans(x)        scanf("%s",x)
#define              min3(a,b,c)     min(a,min(b,c))
#define              max3(a,b,c)     max(a,max(b,c))
#define              min4(a,b,c,d)   min(min(a,b),min(c,d))
#define              max4(a,b,c,d)   max(max(a,b),max(c,d))
#define              max5(a,b,c,d,e) max(max3(a,b,c),max(d,e))
#define              min5(a,b,c,d,e) min(min3(a,b,c),min(d,e))

#define              bitCheck(a,k)     ((bool)(a&(1<<(k))))
#define              bitOff(a,k)       (a&(~(1<<(k))))
#define              bitOn(a,k)        (a|(1<<(k)))
#define              bitFlip(a,k)      (a^(1<<(k)))

#define              POPCOUNT           __builtin_popcount
#define              POPCOUNTLL         __builtin_popcountll
#define              RIGHTMOST          __builtin_ctzll
#define              LEFTMOST(x)        (63-__builtin_clzll((x)))
#define              piii               pair<pii,int>

#define scani2(a,b) scani(a) , scani(b)
#define scani3(a,b,c) scani(a), scani(b), scani(c)
#define scani4(a,b,c,d) scani(a), scani(b), scani(c), scani(d)
#define scani5(a,b,c,d,e) scani(a), scani(b), scani(c), scani(d) , scani(e)
#define rnd mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

/*********************Ordered Multiset*************************/

/*** Needs C++11 or C++14 ***/
/// Treap supporting duplicating values in set
/// Maximum value of treap * ADD must fit in long long

/**

struct Treap{ /// hash = 96814
    int len;
    const int ADD = 1000010;
    const int MAXVAL = 1000000010;
    tr1::unordered_map <long long, int> mp; /// Change to int if only int in treap
    tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> T;
    Treap(){
        len = 0;
        T.clear(), mp.clear();
    }
    inline void clear(){
        len = 0;
        T.clear(), mp.clear();
    }
    inline void insert(long long x){
        len++, x += MAXVAL;
        int c = mp[x]++;
        T.insert((x * ADD) + c);
    }
    inline void erase(long long x){
        x += MAXVAL;
        int c = mp[x];
        if (c){
            c--, mp[x]--, len--;
            T.erase((x * ADD) + c);
        }
    }
    /// 1-based index, returns the K'th element in the treap, -1 if none exists
    inline long long kth(int k){
        if (k < 1 || k > len) return -1;
        auto it = T.find_by_order(--k);
        return ((*it) / ADD) - MAXVAL;
    }
    /// Count of value < x in treap
    inline int count(long long x){
        x += MAXVAL;
        int c = mp[--x];
        return (T.order_of_key((x * ADD) + c));
    }
    /// Number of elements in treap
    inline int size(){
        return len;
    }
};

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;///*X.find_by_order();X.order_of_key();**/
template <class T> inline bool isLeap(T y) {return (y % 400 == 0) || (y % 100 ? y % 4 == 0 : false); }
template< class T > inline T gcd(T a, T b) { return (b) == 0 ? (a) : gcd((b), ((a) % (b))); }
template< class T > inline T lcm(T a, T b) { return ((a) / gcd((a), (b)) * (b)); }
template <class T> inline T BigMod(T Base,T power,T M=mod){if(power==0)return 1;if(power&1)return ((Base%M)*(BigMod(Base,power-1,M)%M))%M;else{T y=BigMod(Base,power/2,M)%M;return (y*y)%M;}}
template <class T> inline T ModInv (T A,T M = mod){return BigMod(A,M-2,M);}

int fx[] = {-1,+0,+1,+0,+1,+1,-1,-1,+0};
int fy[] = {+0,-1,+0,+1,+1,-1,+1,-1,+0};
int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

/*********************** let the play begin() ***********************************/

int arr[MAX][42];int v2[45][5];vector<piii>vv;

bool cmp(const piii &a,const piii &b)
{
    if(a.ff.ff==b.ff.ff)return a.ff.ss<b.ff.ss;
    return a.ff.ff<b.ff.ff;
}

int main()
{
    booster()
    ///read("input.txt");
    int flag = 0;
    for(int i = 0;i<MAX;i++)
    {
        for(int j = 0;j<=40;j++)arr[i][j] = -1;
    }
    for(int i = 0;i<=41;i++)
    {
        v2[i][0] = -1;
        v2[i][1] = -1;
    }
    int n,m;
    cin>>n>>m;
    for(int i = 0;i<m;i++)
    {
        int a,b,q;
        cin>>a>>b>>q;
        vv.pb(piii(pii(a,b),q));
    }
    sort(all(vv),cmp);
    for(int j = 0;j<m;j++)
    {
       int l = vv[j].ff.ff;
       int r = vv[j].ff.ss;

       int q = vv[j].ss;

        vi v;
        while(q)
        {
            v.pb(q%2);
            q/=2;
        }
        while(v.size()<30)v.pb(0);
        reverse(all(v));

        for(int i = 0;i<30;i++)
        {
            int x = v[i];
            if(x==0)
            {
                if(v2[i][1]>=r)flag = 1;
                else if(v2[i][1]>=l&&v2[i][1]<r)
                {
                    arr[v2[i][1]+1][i] = 0;
                    v2[i][0] = max(v2[i][0],v2[i][1]+1);
                }
                else {
                    arr[l][i] = 0;
                    v2[i][0] = max(v2[i][0],l);
                }
            }
            else
            {
                if(v2[i][0]>=l)flag = 1;
                else
                {
                    v2[i][1] = max(v2[i][1],r);
                }
            }

            ///cout<<x<<" "<<v2[i][0]<<" "<<v2[i][1]<<endl;

        }

    }
    if(flag)
    {
        cout<<"NO";
        return 0;
    }
    else cout<<"YES"<<endl;

    for(int i = 0;i<n;i++)
    {
        ll pt = 1,ans = 0;
        for(int j = 29;j>=0;j--)
        {
           /// cout<<arr[i+1][j]<<" ";
            if(arr[i+1][j]==0)continue;
            else ans+=pt;
            pt = pt*2;
        }
        ///cout<<endl;
        cout<<ans<<" ";

    }

    return 0;
}


///#include <stdio.h>
///#include <iostream>
///#include <cstring>
///#include <cmath>
///#include <algorithm>
///#include <string>
///#include <vector>
///#include <map>
///#include <set>
///#include <queue>
///#include <cstdlib>
///#include <limits>
///#include <iostream>
///#include <sstream>
///#include <unordered_set>
///#include <unordered_map>
///#include <random>
#include <bits/stdc++.h>
///#include <bits/stdtr1c++.h>
///#include <ext/pb_ds/assoc_container.hpp>
///#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
///using namespace __gnu_pbds;
#define              MAX             100005
#define              EPS             1e-9
#define              ull             unsigned long long
#define              ll              long long
#define              inf             INT_MAX
#define              pi              acos(-1.0)
#define              vi              vector<int>
#define              vl              vector<long long>
#define              pii             pair<int,int>
#define              pll             pair<long long,long long>
#define              mp              make_pair
#define              mem(a, v)       memset(a, v, sizeof (a))
#define              mod             1000000007
#define              all(a)          a.begin(),a.end()
#define              rall(a)         a.rbegin(),a.rend()
#define              ff              first
#define              ss              second
#define              arsort(ar,n)    sort(ar,ar+n);
#define              vsort(v)        sort(v.begin(),v.end())
#define              vrev(v)         reverse(v.begin(),v.end())
#define              arrev(ar,n)     reverse(ar,ar+n)
#define              pb              push_back
#define              popb            pop_back
#define              booster()       ios_base::sync_with_stdio(0); cin.tie(0);
#define              read(f)         freopen(f, "r", stdin)
#define              scani(x)        scanf("%d",&x)
#define              scanl(x)        scanf("%I64d",&x)
#define              scand(x)        scanf("%lf",&x)
#define              scans(x)        scanf("%s",x)
#define              min3(a,b,c)     min(a,min(b,c))
#define              max3(a,b,c)     max(a,max(b,c))
#define              min4(a,b,c,d)   min(min(a,b),min(c,d))
#define              max4(a,b,c,d)   max(max(a,b),max(c,d))
#define              max5(a,b,c,d,e) max(max3(a,b,c),max(d,e))
#define              min5(a,b,c,d,e) min(min3(a,b,c),min(d,e))

#define              bitCheck(a,k)     ((bool)(a&(1<<(k))))
#define              bitOff(a,k)       (a&(~(1<<(k))))
#define              bitOn(a,k)        (a|(1<<(k)))
#define              bitFlip(a,k)      (a^(1<<(k)))

#define              POPCOUNT           __builtin_popcount
#define              POPCOUNTLL         __builtin_popcountll
#define              RIGHTMOST          __builtin_ctzll
#define              LEFTMOST(x)        (63-__builtin_clzll((x)))
#define              piii               pair<pii,int>

#define scani2(a,b) scani(a) , scani(b)
#define scani3(a,b,c) scani(a), scani(b), scani(c)
#define scani4(a,b,c,d) scani(a), scani(b), scani(c), scani(d)
#define scani5(a,b,c,d,e) scani(a), scani(b), scani(c), scani(d) , scani(e)
#define rnd mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

/*********************Ordered Multiset*************************/

/*** Needs C++11 or C++14 ***/
/// Treap supporting duplicating values in set
/// Maximum value of treap * ADD must fit in long long

/**

struct Treap{ /// hash = 96814
    int len;
    const int ADD = 1000010;
    const int MAXVAL = 1000000010;
    tr1::unordered_map <long long, int> mp; /// Change to int if only int in treap
    tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> T;
    Treap(){
        len = 0;
        T.clear(), mp.clear();
    }
    inline void clear(){
        len = 0;
        T.clear(), mp.clear();
    }
    inline void insert(long long x){
        len++, x += MAXVAL;
        int c = mp[x]++;
        T.insert((x * ADD) + c);
    }
    inline void erase(long long x){
        x += MAXVAL;
        int c = mp[x];
        if (c){
            c--, mp[x]--, len--;
            T.erase((x * ADD) + c);
        }
    }
    /// 1-based index, returns the K'th element in the treap, -1 if none exists
    inline long long kth(int k){
        if (k < 1 || k > len) return -1;
        auto it = T.find_by_order(--k);
        return ((*it) / ADD) - MAXVAL;
    }
    /// Count of value < x in treap
    inline int count(long long x){
        x += MAXVAL;
        int c = mp[--x];
        return (T.order_of_key((x * ADD) + c));
    }
    /// Number of elements in treap
    inline int size(){
        return len;
    }
};

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;///*X.find_by_order();X.order_of_key();**/
template <class T> inline bool isLeap(T y) {return (y % 400 == 0) || (y % 100 ? y % 4 == 0 : false); }
template< class T > inline T gcd(T a, T b) { return (b) == 0 ? (a) : gcd((b), ((a) % (b))); }
template< class T > inline T lcm(T a, T b) { return ((a) / gcd((a), (b)) * (b)); }
template <class T> inline T BigMod(T Base,T power,T M=mod){if(power==0)return 1;if(power&1)return ((Base%M)*(BigMod(Base,power-1,M)%M))%M;else{T y=BigMod(Base,power/2,M)%M;return (y*y)%M;}}
template <class T> inline T ModInv (T A,T M = mod){return BigMod(A,M-2,M);}

int fx[] = {-1,+0,+1,+0,+1,+1,-1,-1,+0};
int fy[] = {+0,-1,+0,+1,+1,-1,+1,-1,+0};
int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

/*********************** let the play begin() ***********************************/

int arr[MAX][42];int v2[45][5];vector<piii>vv;

bool cmp(const piii &a,const piii &b)
{
    if(a.ff.ff==b.ff.ff)return a.ff.ss<b.ff.ss;
    return a.ff.ff<b.ff.ff;
}

int main()
{
    booster()
    ///read("input.txt");
    int flag = 0;
    for(int i = 0;i<MAX;i++)
    {
        for(int j = 0;j<=40;j++)arr[i][j] = -1;
    }
    for(int i = 0;i<=41;i++)
    {
        v2[i][0] = -1;
        v2[i][1] = -1;
    }
    int n,m;
    cin>>n>>m;
    for(int i = 0;i<m;i++)
    {
        int a,b,q;
        cin>>a>>b>>q;
        vv.pb(piii(pii(a,b),q));
    }
    sort(all(vv),cmp);
    for(int j = 0;j<m;j++)
    {
       int l = vv[j].ff.ff;
       int r = vv[j].ff.ss;

        int q = vv[j].ss;

        vi v;
        while(q)
        {
            v.pb(q%2);
            q/=2;
        }
        while(v.size()<=40)v.pb(0);
        reverse(all(v));

        for(int i = 0;i<=40;i++)
        {
            int x = v[i];
            if(x==0)
            {
                if(v2[i][1]>=r)flag = 1;
                else if(v2[i][1]>=l&&v2[i][1]<r)
                {
                    arr[v2[i][1]+1][i] = 0;
                    v2[i][0] = max(v2[i][0],v2[i][1]+1);
                }
                else {
                    arr[l][i] = 0;
                    v2[i][0] = max(v2[i][0],l);
                }
            }
            else
            {
                if(v2[i][0]>=l)flag = 1;
                else
                {
                    v2[i][1] = max(v2[i][1],r);
                }
            }

        }

    }
    if(flag)
    {
        cout<<"NO";
        return 0;
    }
    else cout<<"YES"<<endl;

    for(int i = 0;i<n;i++)
    {
        ll pt = 1,ans = 0;
        for(int j = 0;j<=40;j++)
        {
            if(arr[i+1][j]==0)continue;
            else ans+=pt;
            pt = pt*2;
        }
        cout<<ans<<" ";

    }

    return 0;
}


///#include <stdio.h>
///#include <iostream>
///#include <cstring>
///#include <cmath>
///#include <algorithm>
///#include <string>
///#include <vector>
///#include <map>
///#include <set>
///#include <queue>
///#include <cstdlib>
///#include <limits>
///#include <iostream>
///#include <sstream>
///#include <unordered_set>
///#include <unordered_map>
///#include <random>
#include <bits/stdc++.h>
///#include <bits/stdtr1c++.h>
///#include <ext/pb_ds/assoc_container.hpp>
///#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
///using namespace __gnu_pbds;
#define              MAX             100005
#define              EPS             1e-9
#define              ull             unsigned long long
#define              ll              long long
#define              inf             INT_MAX
#define              pi              acos(-1.0)
#define              vi              vector<int>
#define              vl              vector<long long>
#define              pii             pair<int,int>
#define              pll             pair<long long,long long>
#define              mp              make_pair
#define              mem(a, v)       memset(a, v, sizeof (a))
#define              mod             1000000007
#define              all(a)          a.begin(),a.end()
#define              rall(a)         a.rbegin(),a.rend()
#define              ff              first
#define              ss              second
#define              arsort(ar,n)    sort(ar,ar+n);
#define              vsort(v)        sort(v.begin(),v.end())
#define              vrev(v)         reverse(v.begin(),v.end())
#define              arrev(ar,n)     reverse(ar,ar+n)
#define              pb              push_back
#define              popb            pop_back
#define              booster()       ios_base::sync_with_stdio(0); cin.tie(0);
#define              read(f)         freopen(f, "r", stdin)
#define              scani(x)        scanf("%d",&x)
#define              scanl(x)        scanf("%I64d",&x)
#define              scand(x)        scanf("%lf",&x)
#define              scans(x)        scanf("%s",x)
#define              min3(a,b,c)     min(a,min(b,c))
#define              max3(a,b,c)     max(a,max(b,c))
#define              min4(a,b,c,d)   min(min(a,b),min(c,d))
#define              max4(a,b,c,d)   max(max(a,b),max(c,d))
#define              max5(a,b,c,d,e) max(max3(a,b,c),max(d,e))
#define              min5(a,b,c,d,e) min(min3(a,b,c),min(d,e))

#define              bitCheck(a,k)     ((bool)(a&(1<<(k))))
#define              bitOff(a,k)       (a&(~(1<<(k))))
#define              bitOn(a,k)        (a|(1<<(k)))
#define              bitFlip(a,k)      (a^(1<<(k)))

#define              POPCOUNT           __builtin_popcount
#define              POPCOUNTLL         __builtin_popcountll
#define              RIGHTMOST          __builtin_ctzll
#define              LEFTMOST(x)        (63-__builtin_clzll((x)))
#define              piii               pair<pii,int>
#define              BIT                29

#define scani2(a,b) scani(a) , scani(b)
#define scani3(a,b,c) scani(a), scani(b), scani(c)
#define scani4(a,b,c,d) scani(a), scani(b), scani(c), scani(d)
#define scani5(a,b,c,d,e) scani(a), scani(b), scani(c), scani(d) , scani(e)
#define rnd mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

/*********************Ordered Multiset*************************/

/*** Needs C++11 or C++14 ***/
/// Treap supporting duplicating values in set
/// Maximum value of treap * ADD must fit in long long

/**

struct Treap{ /// hash = 96814
    int len;
    const int ADD = 1000010;
    const int MAXVAL = 1000000010;
    tr1::unordered_map <long long, int> mp; /// Change to int if only int in treap
    tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> T;
    Treap(){
        len = 0;
        T.clear(), mp.clear();
    }
    inline void clear(){
        len = 0;
        T.clear(), mp.clear();
    }
    inline void insert(long long x){
        len++, x += MAXVAL;
        int c = mp[x]++;
        T.insert((x * ADD) + c);
    }
    inline void erase(long long x){
        x += MAXVAL;
        int c = mp[x];
        if (c){
            c--, mp[x]--, len--;
            T.erase((x * ADD) + c);
        }
    }
    /// 1-based index, returns the K'th element in the treap, -1 if none exists
    inline long long kth(int k){
        if (k < 1 || k > len) return -1;
        auto it = T.find_by_order(--k);
        return ((*it) / ADD) - MAXVAL;
    }
    /// Count of value < x in treap
    inline int count(long long x){
        x += MAXVAL;
        int c = mp[--x];
        return (T.order_of_key((x * ADD) + c));
    }
    /// Number of elements in treap
    inline int size(){
        return len;
    }
};

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;///*X.find_by_order();X.order_of_key();**/
template <class T> inline bool isLeap(T y) {return (y % 400 == 0) || (y % 100 ? y % 4 == 0 : false); }
template< class T > inline T gcd(T a, T b) { return (b) == 0 ? (a) : gcd((b), ((a) % (b))); }
template< class T > inline T lcm(T a, T b) { return ((a) / gcd((a), (b)) * (b)); }
template <class T> inline T BigMod(T Base,T power,T M=mod){if(power==0)return 1;if(power&1)return ((Base%M)*(BigMod(Base,power-1,M)%M))%M;else{T y=BigMod(Base,power/2,M)%M;return (y*y)%M;}}
template <class T> inline T ModInv (T A,T M = mod){return BigMod(A,M-2,M);}

int fx[] = {-1,+0,+1,+0,+1,+1,-1,-1,+0};
int fy[] = {+0,-1,+0,+1,+1,-1,+1,-1,+0};
int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

/*********************** let the play begin() ***********************************/

int l[MAX],r[MAX],q[MAX],a[MAX],sum[MAX],tree[5*MAX];

void Build(int node,int b,int e)
{
    if(b==e)
    {
        tree[node] = a[b];
        return ;
    }
    int mid = (b+e)>>1;
    int left = 2*node;
    int right = left+1;
    Build(left,b,mid);
    Build(right,mid+1,e);
    tree[node] = tree[left]&tree[right];
}

int query(int node,int b,int e,int l,int r)
{
    if(b>r||l>e)return 0;
    if(b>=l&&e<=r)return tree[node];
    int mid = (b+e)>>1;
    int left = 2*node;
    int right = left+1;
    int p1 = query(left,b,mid,l,r);
    int p2 = query(right,mid+1,e,l,r);
    return p1&p2;
}

int main()
{
    booster()
    ///read("input.txt");
    int n,m;
    cin>>n>>m;
    for(int i = 1;i<=m;i++)
    {
        cin>>l[i]>>r[i]>>q[i];
    }
    for(int i = 0;i<=BIT;i++)
    {
        for(int j = 1;j<=n;j++)sum[j] = 0;
        for(int j = 1;j<=m;j++)
        {
            if(bitCheck(q[j],i))
            {
                sum[l[j]]++;
                sum[r[j]+1]--;
            }
        }
        for(int j = 1;j<=n;j++)
        {
            sum[j] += sum[j-1];
            if(sum[j])a[j] = bitOn(a[j],i);
        }
    }

    Build(1,1,n);

    for(int i = 1;i<=m;i++)
    {
        if(query(1,1,n,l[i],r[i])!=q[i])
        {
            cout<<"NO";
            return 0;
        }
    }
    cout<<"YES"<<endl;
    for(int i = 1;i<=n;i++)cout<<a[i]<<" ";

    return 0;
}


#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e5+100;
typedef long long LL;
LL l[maxn],r[maxn],p[maxn],n,m;
struct SeamentTree{
	LL l,r,add,val;
}tree[maxn*4];
void spread(LL p)
{
	if(tree[p].add)
	{
	   tree[p*2].val|=tree[p].val;
	   tree[p*2+1].val|=tree[p].val;
	   tree[p*2].add|=tree[p].add;
	   tree[p*2+1].add|=tree[p].add;
	   tree[p].add=0;
	}
}
void build(LL p,LL l,LL r)
{
	tree[p].l=l;tree[p].r=r;
	if(l==r){tree[p].val=0;return;}
	LL mid=(l+r)/2;
	build(p*2,l,mid);
	build(p*2+1,mid+1,r);
//	tree[p].val=tree[p*2].val=tree[p*2+1].val=0;
	spread(p);
}
void change(LL p,LL l,LL r,LL d)
{
	if(l<=tree[p].l&&r>=tree[p].r)
	{
		tree[p].val|=d;
		tree[p].add|=d;
		return;
	}
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	if(l<=mid) change(p*2,l,mid,d);
	if(r>mid) change(p*2+1,mid+1,r,d);
	tree[p].val|=tree[p*2].val;tree[p].val|=tree[p*2+1].val;
}
LL query(LL p,LL l,LL r)
{
	if(l<=tree[p].l&&r>=tree[p].r) return tree[p].val;
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	LL res=0x3f3f3f3f3f;
	if(l<=mid) res&=query(p*2,l,r);
	if(r>mid) res&=query(p*2+1,l,r);
	return res;
}
bool judge()
{
//	for(LL i=1;i<=n;i++){
//		cout<<query(1,i,i)<<" ";
//	}
	for(LL i=1;i<=m;i++)
	{
	//	cout<<query(1,l[i],r[i])<<endl;
		if(query(1,l[i],r[i])!=p[i]) return true;
	}
	cout<<"YES"<<endl;
	for(LL i=1;i<n;i++){
		cout<<query(1,i,i)<<" ";
	}
	cout<<query(1,n,n)<<endl;
	return false;
}
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  cin>>n>>m;
  build(1,1,n);
  for(LL i=1;i<=m;i++)
  {
	 cin>>l[i]>>r[i]>>p[i];
	 change(1,l[i],r[i],p[i]);
  }
  if(judge()) cout<<"NO"<<endl;
return 0;
}


#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e5+100;
typedef long long LL;
LL l[maxn],r[maxn],p[maxn],n,m;
struct SeamentTree{
	LL l,r,add,val;
}tree[maxn*4];
void build(LL p,LL l,LL r)
{
	tree[p].l=l;tree[p].r=r;
	if(l==r){tree[p].val=0;return;}
	LL mid=(l+r)/2;
	build(p*2,l,mid);
	build(p*2+1,mid+1,r);
	tree[p].val=tree[p*2].val=tree[p*2+1].val=0;
}
void spread(LL p)
{
	if(tree[p].add)
	{
	   tree[p*2].val|=tree[p].val;
	   tree[p*2+1].val|=tree[p].val;
	   tree[p*2].add+=tree[p].add;
	   tree[p*2+1].add+=tree[p].add;
	   tree[p].add=0;
	}
}
void change(LL p,LL l,LL r,LL d)
{
	if(l<=tree[p].l&&r>=tree[p].r)
	{
		tree[p].val|=d;
		tree[p].add+=d;
		return;
	}
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	if(l<=mid) change(p*2,l,mid,d);
	if(r>mid) change(p*2+1,mid+1,r,d);
	tree[p].val|=tree[p*2].val;tree[p].val|=tree[p*2+1].val;
}
LL query(LL p,LL l,LL r)
{
	if(l<=tree[p].l&&r>=tree[p].r) return tree[p].val;
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	LL res=0;
	if(l<=mid) res|=query(p*2,l,r);
	if(r>mid) res|=query(p*2+1,l,r);
	return res;
}
bool judge()
{
//	for(LL i=1;i<=n;i++){
//		cout<<query(1,i,i)<<" ";
//	}
	for(LL i=1;i<=m;i++)
	{
	//	cout<<query(1,l[i],r[i])<<endl;
		if(query(1,l[i],r[i])!=p[i]) return true;
	}
	cout<<"YES"<<endl;
	for(LL i=1;i<n;i++){
		cout<<query(1,i,i)<<" ";
	}
	cout<<query(1,n,n)<<endl;
	return false;
}
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  cin>>n>>m;
  build(1,1,n);
  for(LL i=1;i<=m;i++)
  {
	 cin>>l[i]>>r[i]>>p[i];
	 change(1,l[i],r[i],p[i]);
  }
  if(judge()) cout<<"NO"<<endl;
return 0;
}


#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
#define INF (1e18)-1
using namespace std;
const int maxn=1e5+100;
typedef long long LL;
LL l[maxn],r[maxn],p[maxn],n,m;
struct SeamentTree{
	LL l,r,add,val;
}tree[maxn*4];
void pushup(LL p)
{
	tree[p].val=tree[p*2].val&tree[p*2+1].val;
}
void spread(LL p)
{
	if(tree[p].add)
	{
	   tree[p*2].val|=tree[p].add;
	   tree[p*2+1].val|=tree[p].add;
	   tree[p*2].add|=tree[p].add;
	   tree[p*2+1].add|=tree[p].add;
	   tree[p].add=0;
	}
}
void build(LL p,LL l,LL r)
{
	tree[p].l=l;tree[p].r=r;
	if(l==r){tree[p].val=0;return;}
	LL mid=(l+r)/2;
	build(p*2,l,mid);
	build(p*2+1,mid+1,r);
	pushup(p);
}
void change(LL p,LL l,LL r,LL d)
{
	if(l<=tree[p].l&&r>=tree[p].r)
	{
		tree[p].val|=d;
		tree[p].add|=d;
		return;
	}
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	if(l<=mid) change(p*2,l,r,d);
	if(r>mid) change(p*2+1,l,r,d);
	pushup(p);
}
LL query(LL p,LL l,LL r)
{
	if(l<=tree[p].l&&r>=tree[p].r) return tree[p].val;
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
    LL res=INF;///为啥LL不过阿
	if(l<=mid) res &= query(p*2,l,r);
	if(r>mid) res &= query(p*2+1,l,r);
	return res;
}
bool judge()
{
	for(LL i=1;i<=m;i++)
	{
		if(query(1,l[i],r[i])!=p[i]) return true;
	}
	cout<<"YES"<<endl;
	for(LL i=1;i<n;i++){
		cout<<query(1,i,i)<<" ";
	}
	cout<<query(1,n,n)<<endl;
	return false;
}
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  cin>>n>>m;
  build(1,1,n);
  for(LL i=1;i<=m;i++)
  {
	 cin>>l[i]>>r[i]>>p[i];
	 change(1,l[i],r[i],p[i]);
  }
  if(judge()) cout<<"NO"<<endl;
return 0;
}


#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
#define INF (1e18)-1
using namespace std;
const int maxn=1e5+100;
typedef long long LL;
LL l[maxn],r[maxn],p[maxn],n,m;
struct SeamentTree{
	LL l,r,add,val;
}tree[maxn*4];
void pushup(LL p)
{
	tree[p].val=tree[p*2].val&tree[p*2+1].val;
}
void spread(LL p)
{
	if(tree[p].add)
	{
	   tree[p*2].val|=tree[p].add;
	   tree[p*2+1].val|=tree[p].add;
	   tree[p*2].add|=tree[p].add;
	   tree[p*2+1].add|=tree[p].add;
	   tree[p].add=0;
	}
}
void build(LL p,LL l,LL r)
{
	tree[p].l=l;tree[p].r=r;
	if(l==r){tree[p].val=0;return;}
	LL mid=(l+r)/2;
	build(p*2,l,mid);
	build(p*2+1,mid+1,r);
	pushup(p);
}
void change(LL p,LL l,LL r,LL d)
{
	if(l<=tree[p].l&&r>=tree[p].r)
	{
		tree[p].val|=d;
		tree[p].add|=d;
		return;
	}
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	if(l<=mid) change(p*2,l,r,d);
	if(r>mid) change(p*2+1,l,r,d);
	pushup(p);
}
LL query(LL p,LL l,LL r)
{
	if(l<=tree[p].l&&r>=tree[p].r) return tree[p].val;
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	LL res=INF;
	if(l<=mid) res &= query(p*2,l,r);
	if(r>mid) res &= query(p*2+1,l,r);
	return res;
}
bool judge()
{
	for(LL i=1;i<=m;i++)
	{
		if(query(1,l[i],r[i])!=p[i]) return true;
	}
	cout<<"YES"<<endl;
	for(LL i=1;i<n;i++){
		cout<<query(1,i,i)<<" ";
	}
	cout<<query(1,n,n)<<endl;
	return false;
}
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  cin>>n>>m;
  build(1,1,n);
  for(LL i=1;i<=m;i++)
  {
	 cin>>l[i]>>r[i]>>p[i];
	 change(1,l[i],r[i],p[i]);
  }
  if(judge()) cout<<"NO"<<endl;
return 0;
}


#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
#define INF (1e18)-1
using namespace std;
const int maxn=1e5+100;
typedef long long LL;
LL l[maxn],r[maxn],p[maxn],n,m;
struct SeamentTree{
	LL l,r,add,val;
}tree[maxn*4];
void pushup(LL p)
{
	tree[p].val=tree[p*2].val&tree[p*2+1].val;
}
void spread(LL p)
{
	if(tree[p].add)
	{
	   tree[p*2].val|=tree[p].add;
	   tree[p*2+1].val|=tree[p].add;
	   tree[p*2].add|=tree[p].add;
	   tree[p*2+1].add|=tree[p].add;
	   tree[p].add=0;
	}
}
void build(LL p,LL l,LL r)
{
	tree[p].l=l;tree[p].r=r;
	if(l==r){tree[p].val=0;return;}
	LL mid=(l+r)/2;
	build(p*2,l,mid);
	build(p*2+1,mid+1,r);
	pushup(p);
}
void change(LL p,LL l,LL r,LL d)
{
	if(l<=tree[p].l&&r>=tree[p].r)
	{
		tree[p].val|=d;
		tree[p].add|=d;
		return;
	}
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	if(l<=mid) change(p*2,l,r,d);
	if(r>mid) change(p*2+1,l,r,d);
	pushup(p);
}
LL query(LL p,LL l,LL r)
{
	if(l<=tree[p].l&&r>=tree[p].r) return tree[p].val;
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
    int res=INF;///为啥LL不过阿
//	debug(res);
//	LL ans=INF;
//	debug(ans);
	if(l<=mid) res &= query(p*2,l,r);
	if(r>mid) res &= query(p*2+1,l,r);
	return res;
}
bool judge()
{
	for(LL i=1;i<=m;i++)
	{
		if(query(1,l[i],r[i])!=p[i]) return true;
	}
	cout<<"YES"<<endl;
	for(LL i=1;i<n;i++){
		cout<<query(1,i,i)<<" ";
	}
	cout<<query(1,n,n)<<endl;
	return false;
}
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  cin>>n>>m;
  build(1,1,n);
  for(LL i=1;i<=m;i++)
  {
	 cin>>l[i]>>r[i]>>p[i];
	 change(1,l[i],r[i],p[i]);
  }
  if(judge()) cout<<"NO"<<endl;
return 0;
}


#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e5+100;
typedef long long LL;
LL l[maxn],r[maxn],p[maxn],n,m;
struct SeamentTree{
	LL l,r,add,val;
}tree[maxn*4];
void pushup(LL p)
{
	tree[p].val=tree[p*2].val&tree[p*2+1].val;
}
void spread(LL p)
{
	if(tree[p].add)
	{
	   tree[p*2].val|=tree[p].val;
	   tree[p*2+1].val|=tree[p].val;
	   tree[p*2].add|=tree[p].add;
	   tree[p*2+1].add|=tree[p].add;
	   tree[p].add=0;
	}
}
void build(LL p,LL l,LL r)
{
	tree[p].l=l;tree[p].r=r;
	if(l==r){tree[p].val=0;return;}
	LL mid=(l+r)/2;
	build(p*2,l,mid);
	build(p*2+1,mid+1,r);
	pushup(p);
}
void change(LL p,LL l,LL r,LL d)
{
	if(l<=tree[p].l&&r>=tree[p].r)
	{
		tree[p].val|=d;
		tree[p].add|=d;
		return;
	}
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	if(l<=mid) change(p*2,l,mid,d);
	if(r>mid) change(p*2+1,mid+1,r,d);
	pushup(p);
}
LL query(LL p,LL l,LL r)
{
	if(l<=tree[p].l&&r>=tree[p].r) return tree[p].val;
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	LL res=0x3f3f3f3f3f;
	if(l<=mid) res&=query(p*2,l,r);
	if(r>mid) res&=query(p*2+1,l,r);
	return res;
}
bool judge()
{

	for(LL i=1;i<=m;i++)
	{
		if(query(1,l[i],r[i])!=p[i]) return true;
	}
	cout<<"YES"<<endl;
	for(LL i=1;i<n;i++){
		cout<<query(1,i,i)<<" ";
	}
	cout<<query(1,n,n)<<endl;
	return false;
}
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  cin>>n>>m;
  build(1,1,n);
  for(LL i=1;i<=m;i++)
  {
	 cin>>l[i]>>r[i]>>p[i];
	 change(1,l[i],r[i],p[i]);
  }
  if(judge()) cout<<"NO"<<endl;
return 0;
}


#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
#define INF (1e18)-1
using namespace std;
const int maxn=1e5+100;
typedef long long LL;
LL l[maxn],r[maxn],p[maxn],n,m;
struct SeamentTree{
	LL l,r,add,val;
}tree[maxn*4];
void pushup(LL p)
{
	tree[p].val=tree[p*2].val&tree[p*2+1].val;
}
void spread(LL p)
{
	if(tree[p].add)
	{
	   tree[p*2].val|=tree[p].add;
	   tree[p*2+1].val|=tree[p].add;
	   tree[p*2].add|=tree[p].add;
	   tree[p*2+1].add|=tree[p].add;
	   tree[p].add=0;
	}
}
void build(LL p,LL l,LL r)
{
	tree[p].l=l;tree[p].r=r;
	if(l==r){tree[p].val=0;return;}
	LL mid=(l+r)/2;
	build(p*2,l,mid);
	build(p*2+1,mid+1,r);
	pushup(p);
}
void change(LL p,LL l,LL r,LL d)
{
	if(l<=tree[p].l&&r>=tree[p].r)
	{
		tree[p].val|=d;
		tree[p].add|=d;
		return;
	}
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	if(l<=mid) change(p*2,l,r,d);
	if(r>mid) change(p*2+1,l,r,d);
	pushup(p);
}
LL query(LL p,LL l,LL r)
{
	if(l<=tree[p].l&&r>=tree[p].r) return tree[p].val;
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	int res=INF;
	if(l<=mid) res &= query(p*2,l,r);
	if(r>mid) res &= query(p*2+1,l,r);
	return res;
}
bool judge()
{
	for(LL i=1;i<=m;i++)
	{
		if(query(1,l[i],r[i])!=p[i]) return true;
	}
	cout<<"YES"<<endl;
	for(LL i=1;i<n;i++){
		cout<<query(1,i,i)<<" ";
	}
	cout<<query(1,n,n)<<endl;
	return false;
}
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  cin>>n>>m;
  build(1,1,n);
  for(LL i=1;i<=m;i++)
  {
	 cin>>l[i]>>r[i]>>p[i];
	 change(1,l[i],r[i],p[i]);
  }
  if(judge()) cout<<"NO"<<endl;
return 0;
}


#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e5+100;
typedef long long LL;
LL l[maxn],r[maxn],p[maxn],n,m;
struct SeamentTree{
	LL l,r,add,val;
}tree[maxn*4];
void build(LL p,LL l,LL r)
{
	tree[p].l=l;tree[p].r=r;
	if(l==r){tree[p].val=0;return;}
	LL mid=(l+r)/2;
	build(p*2,l,mid);
	build(p*2+1,mid+1,r);
	tree[p].val=tree[p*2].val=tree[p*2+1].val=0;
}
void spread(LL p)
{
	if(tree[p].add)
	{
	   tree[p*2].val|=tree[p].val;
	   tree[p*2+1].val|=tree[p].val;
	   tree[p*2].add+=tree[p].add;
	   tree[p*2+1].add+=tree[p].add;
	   tree[p].add=0;
	}
}
void change(LL p,LL l,LL r,LL d)
{
	if(l<=tree[p].l&&r>=tree[p].r)
	{
		tree[p].val|=d;
		tree[p].add+=d;
		return;
	}
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	if(l<=mid) change(p*2,l,mid,d);
	if(r>mid) change(p*2+1,mid+1,r,d);
	tree[p].val|=tree[p*2].val;tree[p].val|=tree[p*2+1].val;
}
LL query(LL p,LL l,LL r)
{
	if(l<=tree[p].l&&r>=tree[p].r) return tree[p].val;
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	LL res=0x3f3f3f3f3f;
	if(l<=mid) res&=query(p*2,l,r);
	if(r>mid) res&=query(p*2+1,l,r);
	return res;
}
bool judge()
{
//	for(LL i=1;i<=n;i++){
//		cout<<query(1,i,i)<<" ";
//	}
	for(LL i=1;i<=m;i++)
	{
	//	cout<<query(1,l[i],r[i])<<endl;
		if(query(1,l[i],r[i])!=p[i]) return true;
	}
	cout<<"YES"<<endl;
	for(LL i=1;i<n;i++){
		cout<<query(1,i,i)<<" ";
	}
	cout<<query(1,n,n)<<endl;
	return false;
}
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  cin>>n>>m;
  build(1,1,n);
  for(LL i=1;i<=m;i++)
  {
	 cin>>l[i]>>r[i]>>p[i];
	 change(1,l[i],r[i],p[i]);
  }
  if(judge()) cout<<"NO"<<endl;
return 0;
}


#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e5+100;
typedef long long LL;
LL l[maxn],r[maxn],p[maxn],n,m;
struct SeamentTree{
	LL l,r,add,val;
}tree[maxn*4];
void pushup(LL p)
{
	tree[p].val=tree[p*2].val&tree[p*2+1].val;
}
void spread(LL p)
{
	if(tree[p].add)
	{
	   tree[p*2].val|=tree[p].val;
	   tree[p*2+1].val|=tree[p].val;
	   tree[p*2].add|=tree[p].add;
	   tree[p*2+1].add|=tree[p].add;
	   tree[p].add=0;
	}
}
void build(LL p,LL l,LL r)
{
	tree[p].add=0;
	tree[p].l=l;tree[p].r=r;
	if(l==r){tree[p].val=0;return;}
	LL mid=(l+r)/2;
	build(p*2,l,mid);
	build(p*2+1,mid+1,r);
	pushup(p);
}
void change(LL p,LL l,LL r,LL d)
{
	if(l<=tree[p].l&&r>=tree[p].r)
	{
		tree[p].val|=d;
		tree[p].add|=d;
		return;
	}
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	if(l<=mid) change(p*2,l,mid,d);
	if(r>mid) change(p*2+1,mid+1,r,d);
	pushup(p);
}
LL query(LL p,LL l,LL r)
{
	if(l<=tree[p].l&&r>=tree[p].r) return tree[p].val;
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	LL res=0x3f3f3f3f3f;
	if(l<=mid) res&=query(p*2,l,r);
	if(r>mid) res&=query(p*2+1,l,r);
	return res;
}
bool judge()
{

	for(LL i=1;i<=m;i++)
	{
		if(query(1,l[i],r[i])!=p[i]) return true;
	}
	cout<<"YES"<<endl;
	for(LL i=1;i<n;i++){
		cout<<query(1,i,i)<<" ";
	}
	cout<<query(1,n,n)<<endl;
	return false;
}
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  cin>>n>>m;
  build(1,1,n);
  for(LL i=1;i<=m;i++)
  {
	 cin>>l[i]>>r[i]>>p[i];
	 change(1,l[i],r[i],p[i]);
  }
  if(judge()) cout<<"NO"<<endl;
return 0;
}


#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e5+100;
typedef long long LL;
const LL inf=92233720368547758;
LL l[maxn],r[maxn],p[maxn],n,m;
struct SeamentTree{
	LL l,r,add,val;
}tree[maxn*4];
void pushup(LL p)
{
	tree[p].val=tree[p*2].val&tree[p*2+1].val;
}
void spread(LL p)
{
	if(tree[p].add)
	{
	   tree[p*2].val|=tree[p].add;
	   tree[p*2+1].val|=tree[p].add;
	   tree[p*2].add|=tree[p].add;
	   tree[p*2+1].add|=tree[p].add;
	   tree[p].add=0;
	}
}
void build(LL p,LL l,LL r)
{
	tree[p].l=l;tree[p].r=r;
	if(l==r){tree[p].val=0;return;}
	LL mid=(l+r)/2;
	build(p*2,l,mid);
	build(p*2+1,mid+1,r);
	pushup(p);
}
void change(LL p,LL l,LL r,LL d)
{
	if(l<=tree[p].l&&r>=tree[p].r)
	{
		tree[p].val|=d;
		tree[p].add|=d;
		return;
	}
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	if(l<=mid) change(p*2,l,r,d);
	if(r>mid) change(p*2+1,l,r,d);
	pushup(p);
}
LL query(LL p,LL l,LL r)
{
	if(l<=tree[p].l&&r>=tree[p].r) return tree[p].val;
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	LL res=inf;
	debug(res);
	if(l<=mid) res &= query(p*2,l,r);
	if(r>mid) res &= query(p*2+1,l,r);
	return res;
}
bool judge()
{

	for(LL i=1;i<=n;i++){
		cout<<query(1,i,i)<<" ";
	}
	cout<<endl;
	for(LL i=1;i<=m;i++)
	{
		cout<<query(1,l[i],r[i])<<" "<<p[i]<<endl;
		if(query(1,l[i],r[i])!=p[i]) return true;
	}
	cout<<"YES"<<endl;
	for(LL i=1;i<n;i++){
		cout<<query(1,i,i)<<" ";
	}
	cout<<query(1,n,n)<<endl;
	return false;
}
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  cin>>n>>m;
  build(1,1,n);
  for(LL i=1;i<=m;i++)
  {
	 cin>>l[i]>>r[i]>>p[i];
	 change(1,l[i],r[i],p[i]);
	 cout<<query(1,l[i],r[i])<<" "<<p[i]<<endl;
  }
  if(judge()) cout<<"NO"<<endl;
return 0;
}


#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e5+100;
typedef long long LL;
const LL inf=92233720368547758;
LL l[maxn],r[maxn],p[maxn],n,m;
struct SeamentTree{
	LL l,r,add,val;
}tree[maxn*4];
void pushup(LL p)
{
	tree[p].val=tree[p*2].val&tree[p*2+1].val;
}
void spread(LL p)
{
	if(tree[p].add)
	{
	   tree[p*2].val|=tree[p].add;
	   tree[p*2+1].val|=tree[p].add;
	   tree[p*2].add|=tree[p].add;
	   tree[p*2+1].add|=tree[p].add;
	   tree[p].add=0;
	}
}
void build(LL p,LL l,LL r)
{
	tree[p].l=l;tree[p].r=r;
	if(l==r){tree[p].val=0;return;}
	LL mid=(l+r)/2;
	build(p*2,l,mid);
	build(p*2+1,mid+1,r);
	pushup(p);
}
void change(LL p,LL l,LL r,LL d)
{
	if(l<=tree[p].l&&r>=tree[p].r)
	{
		tree[p].val|=d;
		tree[p].add|=d;
		return;
	}
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	if(l<=mid) change(p*2,l,r,d);
	if(r>mid) change(p*2+1,l,r,d);
	pushup(p);
}
LL query(LL p,LL l,LL r)
{
	if(l<=tree[p].l&&r>=tree[p].r) return tree[p].val;
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	LL res=0x3f3f3f3f;
	if(l<=mid) res &= query(p*2,l,r);
	if(r>mid) res &= query(p*2+1,l,r);
	return res;
}
bool judge()
{
	for(LL i=1;i<=m;i++)
	{
		if(query(1,l[i],r[i])!=p[i]) return true;
	}
	cout<<"YES"<<endl;
	for(LL i=1;i<n;i++){
		cout<<query(1,i,i)<<" ";
	}
	cout<<query(1,n,n)<<endl;
	return false;
}
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  cin>>n>>m;
  build(1,1,n);
  for(LL i=1;i<=m;i++)
  {
	 cin>>l[i]>>r[i]>>p[i];
	 change(1,l[i],r[i],p[i]);
  }
  if(judge()) cout<<"NO"<<endl;
return 0;
}


#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e5+100;
typedef long long LL;
const LL inf=92233720368547758;
LL l[maxn],r[maxn],p[maxn],n,m;
struct SeamentTree{
	LL l,r,add,val;
}tree[maxn*4];
void pushup(LL p)
{
	tree[p].val=tree[p*2].val&tree[p*2+1].val;
}
void spread(LL p)
{
	if(tree[p].add)
	{
	   tree[p*2].val|=tree[p].add;
	   tree[p*2+1].val|=tree[p].add;
	   tree[p*2].add|=tree[p].add;
	   tree[p*2+1].add|=tree[p].add;
	   tree[p].add=0;
	}
}
void build(LL p,LL l,LL r)
{
	tree[p].l=l;tree[p].r=r;
	if(l==r){tree[p].val=0;return;}
	LL mid=(l+r)/2;
	build(p*2,l,mid);
	build(p*2+1,mid+1,r);
	pushup(p);
}
void change(LL p,LL l,LL r,LL d)
{
	if(l<=tree[p].l&&r>=tree[p].r)
	{
		tree[p].val|=d;
		tree[p].add|=d;
		return;
	}
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	if(l<=mid) change(p*2,l,r,d);
	if(r>mid) change(p*2+1,l,r,d);
	pushup(p);
}
LL query(LL p,LL l,LL r)
{
	if(l<=tree[p].l&&r>=tree[p].r) return tree[p].val;
	spread(p);
	LL mid=(tree[p].l+tree[p].r)/2;
	LL res=inf;
	debug(res);
	if(l<=mid) res &= query(p*2,l,r);
	if(r>mid) res &= query(p*2+1,l,r);
	return res;
}
bool judge()
{
	cout<<endl;
	for(LL i=1;i<=m;i++)
	{
		if(query(1,l[i],r[i])!=p[i]) return true;
	}
	cout<<"YES"<<endl;
	for(LL i=1;i<n;i++){
		cout<<query(1,i,i)<<" ";
	}
	cout<<query(1,n,n)<<endl;
	return false;
}
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  cin>>n>>m;
  build(1,1,n);
  for(LL i=1;i<=m;i++)
  {
	 cin>>l[i]>>r[i]>>p[i];
	 change(1,l[i],r[i],p[i]);
  }
  if(judge()) cout<<"NO"<<endl;
return 0;
}