#include <bits/stdc++.h>
using namespace std;
struct edge {
  int u, v;
  long long w;
};
int MOD;
const int _MOD = 1000000009;
long long INF = 1e18;
double EPS = 1e-10;
struct segtree {
  segtree *lch, *rch;
  int l, r;
  long long x, dx;
  segtree(int _l, int _r) : l(_l), r(_r), x(INF), dx(0) {
    if (r - l == 1) return;
    int m = (l + r) / 2;
    lch = new segtree(l, m);
    rch = new segtree(m, r);
  }
  void denpan() {
    lch->lazy(x, dx);
    rch->lazy(x, dx);
    x = INF;
    dx = 0;
  }
  void lazy(long long _x, long long _dx) {
    x = min(x, _x - dx);
    dx += _dx;
  }
  void update(int _l, int _r, long long _x, long long _dx) {
    if (r <= _l || _r <= l) return;
    if (_l <= l && r <= _r) {
      lazy(_x, _dx);
      return;
    }
    denpan();
    lch->update(_l, _r, _x, _dx);
    rch->update(_l, _r, _x, _dx);
  }
  long long get(int i) {
    if (r - l == 1) return x + dx;
    denpan();
    int m = (l + r) / 2;
    if (l <= i && i < m) return lch->get(i);
    if (m <= i && i < r) return rch->get(i);
  }
};
struct _segtree {
  _segtree *lch, *rch;
  int l, r;
  long long x, dx;
  _segtree(int _l, int _r) : l(_l), r(_r), x(-1), dx(0) {
    if (r - l == 1) return;
    int m = (l + r) / 2;
    lch = new _segtree(l, m);
    rch = new _segtree(m, r);
  }
  void denpan() {
    lch->lazy(dx);
    rch->lazy(dx);
    dx = 0;
  }
  void merge() { x = max(lch->x + lch->dx, rch->x + rch->dx); }
  void lazy(long long _dx) { dx += _dx; }
  void add(int _l, int _r, long long _dx) {
    if (r <= _l || _r <= l) return;
    if (_l <= l && r <= _r) {
      dx += _dx;
      return;
    }
    denpan();
    lch->add(_l, _r, _dx);
    rch->add(_l, _r, _dx);
    merge();
  }
  long long mx(int _l, int _r) {
    if (r <= _l || _r <= l) return -INF;
    if (_l <= l && r <= _r) return x + dx;
    denpan();
    merge();
    return max(lch->mx(_l, _r), rch->mx(_l, _r));
  }
};
int main() {
  int N, Q;
  cin >> N >> Q;
  vector<int> t(Q), l(Q), r(Q), x(Q);
  for (int k = 0; k < Q; k++) {
    scanf("%d", &t[k]);
    if (t[k] == 1) scanf("%d%d%d", &l[k], &r[k], &x[k]);
    if (t[k] == 2) scanf("%d%d", &l[k], &x[k]);
    l[k]--;
  }
  segtree* st = new segtree(0, N);
  for (int k = Q - 1; k >= 0; k--) {
    if (t[k] == 1) st->update(l[k], r[k], x[k], 0);
    if (t[k] == 2) st->update(l[k], l[k] + 1, INF / 10, INT_MAX);
  }
  vector<long long> a(N);
  for (int i = 0; i < N; i++) a[i] = st->get(i);
  _segtree* _st = new _segtree(0, N);
  for (int i = 0; i < N; i++) _st->add(i, i + 1, a[i] + 1);
  vector<long long> a0 = a;
  for (int k = 0; k < Q; k++) {
    if (t[k] == 1) {
      if (_st->mx(l[k], r[k]) != x[k]) {
        cout << "NO" << endl;
        return 0;
      }
    }
    if (t[k] == 2) {
      int i = l[k];
      _st->add(i, i + 1, x[k] - a[i]);
      a[i] = x[k];
    }
  }
  set<long long> S;
  _segtree* _st2 = new _segtree(0, N);
  for (int i = 0; i < N; i++) a[i] = -1;
  for (int k = 0; k < Q; k++) {
    if (t[k] == 1) {
      if (_st2->mx(l[k], r[k]) != x[k]) S.insert(x[k]);
    }
    if (t[k] == 2) {
      int i = l[k];
      _st2->add(i, i + 1, x[k] - a[i]);
      a[i] = x[k];
    }
  }
  for (int i = 0; i < N; i++) a0[i] = min(a0[i], (long long)1e9 + 1);
  priority_queue<pair<int, int> > pq;
  vector<long long> ans(N);
  long long cute = 0;
  for (int i = 0; i < N; i++) {
    if (S.count(a0[i])) {
      S.erase(a0[i]);
      ans[i] = a0[i];
      cute |= a0[i];
    } else if (a0[i])
      pq.push(pair<int, int>(min(a0[i], (long long)1e9), i));
  }
  for (int i = 0; i < N; i++) a0[i] = min(a0[i], (long long)1e9);
  while (pq.size()) {
    int x = pq.top().first;
    int i = pq.top().second;
    pq.pop();
    int k;
    for (k = 30; k >= 0; k--)
      if (!(cute >> k & 1) && (x >= (1 << k))) break;
    if (k == -1) continue;
    cute |= 1 << k;
    pq.push(pair<int, int>(x - (1 << k), i));
    ans[i] += 1 << k;
  }
  cout << "YES" << endl;
  for (int i = 0; i < N; i++) printf("%d ", ans[i]);
  cout << endl;
}
