#include <bits/stdc++.h>
using namespace std;
const int Max = 1e6 + 10;
int res[Max];
int q[Max * 4];
int n;
int MX[Max * 4];
void upd(int l, int r, int x, int tl = 1, int tr = n + 1, int idx = 1) {
  if (l <= tl && tr <= r) {
    q[idx] = min(q[idx], x);
    return;
  }
  if (r <= tl || tr <= l) return;
  int mid = (tl + tr) / 2;
  upd(l, r, x, tl, mid, idx * 2);
  upd(l, r, x, mid, tr, idx * 2 + 1);
}
int get(int i, int tl = 1, int tr = n + 1, int idx = 1) {
  if (tr - tl == 1) return q[idx];
  int mid = (tl + tr) / 2;
  if (i < mid)
    return min(q[idx], get(i, tl, mid, idx * 2));
  else
    return min(q[idx], get(i, mid, tr, idx * 2 + 1));
}
void BUILD(int tl = 1, int tr = n + 1, int idx = 1) {
  if (tr - tl == 1) {
    MX[idx] = res[tl];
    return;
  }
  int mid = (tl + tr) / 2;
  BUILD(tl, mid, idx * 2);
  BUILD(mid, tr, idx * 2 + 1);
  MX[idx] = max(MX[idx * 2], MX[idx * 2 + 1]);
}
void UPD(int i, int x, int tl = 1, int tr = n + 1, int idx = 1) {
  if (tr - tl == 1) {
    MX[idx] = x;
    return;
  }
  int mid = (tl + tr) / 2;
  if (i < mid)
    UPD(i, x, tl, mid, idx * 2);
  else
    UPD(i, x, mid, tr, idx * 2 + 1);
  MX[idx] = max(MX[idx * 2], MX[idx * 2 + 1]);
}
int ANS(int l, int r, int tl = 1, int tr = n + 1, int idx = 1) {
  if (l <= tl && tr <= r) return MX[idx];
  if (r <= tl || tr <= l) return 0;
  int mid = (tl + tr) / 2;
  return max(ANS(l, r, tl, mid, idx * 2), ANS(l, r, mid, tr, idx * 2 + 1));
}
pair<int, pair<pair<int, int>, int> > Q[Max];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) res[i] = -1;
  for (int i = 1; i <= 4 * n; i++) q[i] = 1000000001;
  int q;
  cin >> q;
  for (int i = 1; i <= q; i++) {
    int ty;
    cin >> ty;
    Q[i].first = ty;
    if (ty == 1) {
      int l, r, x;
      cin >> l >> r >> x;
      Q[i].second.first.first = l;
      Q[i].second.first.second = r;
      Q[i].second.second = x;
      upd(l, r + 1, x);
    } else {
      int idx, d;
      cin >> idx >> d;
      Q[i].second.first.first = idx;
      Q[i].second.first.second = d;
      if (res[idx] == -1) res[idx] = get(idx);
    }
  }
  for (int i = 1; i <= n; i++)
    if (res[i] == -1) res[i] = get(i);
  vector<pair<int, int> > srt;
  for (int i = 1; i <= n; i++) srt.push_back(make_pair(res[i], i));
  sort(srt.begin(), srt.end());
  vector<int> change;
  int covered = 0;
  for (int i = 0; i < n; i++)
    if ((i < n - 1 && srt[i].first == srt[i + 1].first) ||
        srt[i].first == 1000000001)
      change.push_back(srt[i].second);
    else
      covered |= srt[i].first;
  for (int i = change.size(); i--;) {
    if (res[change[i]] == 1000000001) res[change[i]] = 1000000000;
    int x = 0;
    for (int lg = 29; lg >= 0; lg--) {
      if ((1 << lg) & covered) continue;
      if (x + (1 << lg) <= res[change[i]]) x += (1 << lg);
    }
    res[change[i]] = x;
    covered |= x;
  }
  BUILD();
  bool ok = true;
  for (int i = 1; i <= q; i++) {
    int ty = Q[i].first;
    if (ty == 1) {
      int l = Q[i].second.first.first, r = Q[i].second.first.second,
          x = Q[i].second.second;
      ok &= ANS(l, r + 1) == x;
    } else {
      int idx = Q[i].second.first.first, d = Q[i].second.first.second;
      UPD(idx, d);
    }
  }
  if (ok) {
    cout << "YES\n";
    for (int i = 1; i <= n; i++) cout << res[i] << " ";
    cout << '\n';
  } else
    cout << "NO\n";
}
