#include <stdio.h>
#include <algorithm>
#include <map>
using namespace std;

int n;
int type[300005], a[300005], b[300005], c[300005];
int res[300005];
map<int, int> occ;

// Segment Tree 1

int t[600005];

int findmax(int p){
    int res=2e9;
    for (p+=n; p; p>>=1) res = min(res, t[p]);
    return res;
}

void upd(int l, int r, int x){
    for(l+=n, r+=n; l<r; l>>=1, r>>=1){
        if(l&1) t[l] = min(t[l], x), l++;
        if(r&1) r--, t[r] = min(t[r], x);
    }
    return;
}

// Segment Tree 2

int t2[600005];

int findmax(int l, int r){
    int res = -2e9;
    for(l+=n, r+=n; l<r; l>>=1, r>>=1){
        if(l&1) res = max(res, t2[l++]);
        if(r&1) res = max(res, t2[--r]);
    }
    return res;
}

void updval(int p, int val){
    for(t2[p+=n]=val; p>1; p>>=1) t2[p>>1] = max(t2[p], t2[p^1]);
    return;
}

// Main Solution

int main(){
    int m;
    scanf("%d%d", &n, &m);
    for(int i=0; i<2*n; i++) t[i] = 2e9;
    for(int i=0; i<n; i++) res[i] = (2e9)+1;
    for(int i=0; i<m; i++){
        scanf("%d", &type[i]);
        if(type[i] == 1){
            scanf("%d%d%d", &a[i], &b[i], &c[i]);
            a[i]--, b[i]--;
            upd(a[i], b[i]+1, c[i]);
        } else{
            scanf("%d%d", &a[i], &b[i]);
            a[i]--;
            if(res[a[i]] == (2e9)+1) res[a[i]] = findmax(a[i]);
        }
    }
    for(int i=0; i<n; i++) if(res[i] == (2e9)+1) res[i] = findmax(i);
    
    // Check validity of the array
    for(int i=0; i<n; i++) t2[n+i] = res[i];
    for(int i=n-1; i>0; i--) t2[i] = max(t2[i<<1], t2[i<<1|1]);
    for(int i=0; i<m; i++){
        if(type[i] == 1){
            if(findmax(a[i], b[i]+1) != c[i]){ printf("NO"); return 0; }
        } else{
            updval(a[i], b[i]);
        }
    }
    for(int i=0; i<n; i++) if(res[i] < 0){ printf("NO"); return 0; }
    
    // Make the answer optimal
    printf("YES\n");
    for(int i=0; i<n; i++) occ[res[i]]++;
    // - occ[2e9] >= 2 then the optimal OR result can simply be (1<<30)-1
    if(occ[2e9] >= 2){
        for(int i=0; i<n; i++) if(res[i] == 2e9){
            res[i] = 1e9, occ[2e9]--;
            if(occ[2e9] == 0) res[i] = (1<<29)-1;
        }
        for(int i=0; i<n; i++) printf("%d ", res[i]);
        return 0;
    }
    // - otherwise, find the best value for the free 2e9 (if any)
    int orresult = 0;
    for(int i=0; i<n; i++){
        if(res[i] == 0 || res[i] == 2e9) continue; // ignoring this could lead to a critical bug
        occ[res[i]]--;
        if(occ[res[i]]){
            int temp=res[i], pow=0;
            while(temp) pow++, temp /= 2;
            res[i] = (1<<(pow-1))-1;
        }
        orresult |= res[i];
    }
    int tobe=0;
    for(int cur=29; cur>=0; cur--){
        if(orresult&(1<<cur)) continue;
        if(tobe+(1<<cur) > 1e9) continue;
        tobe += (1<<cur);
    }
    for(int i=0; i<n; i++){
        if(res[i] == 2e9) printf("%d ", tobe);
        else printf("%d ", res[i]);
    }
    
    return 0;
}