#include <bits/stdc++.h>
using namespace std;
const int N = 300005;
int type[N], a[N], b[N], c[N];
int ret[N];
bool vis[N];
map<int, int> occ;
int n, m;
int t[2 * N];
int findmax(int p) {
  int ret = INT_MAX;
  for (p += n; p; p >>= 1) ret = min(ret, t[p]);
  return ret;
}
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;
}
int t2[2 * N];
int findmax(int l, int r) {
  int ret = INT_MIN;
  for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
    if (l & 1) ret = max(ret, t2[l++]);
    if (r & 1) ret = max(ret, t2[--r]);
  }
  return ret;
}
void upd(int p, int val) {
  for (t2[p += n] = val; p > 1; p >>= 1) t2[p >> 1] = max(t2[p], t2[p ^ 1]);
  return;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < 2 * n; i++) t[i] = INT_MAX;
  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 (!vis[a[i]]) ret[a[i]] = findmax(a[i]), vis[a[i]] = true;
    }
  }
  for (int i = 0; i < n; i++)
    if (!vis[i]) ret[i] = findmax(i), vis[i] = true;
  for (int i = 0; i < n; i++) t2[n + i] = ret[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\n");
        return 0;
      }
    } else {
      upd(a[i], b[i]);
    }
  }
  for (int i = 0; i < n; i++)
    if (ret[i] < 0) {
      printf("NO\n");
      return 0;
    }
  printf("YES\n");
  for (int i = 0; i < n; i++) occ[ret[i]]++;
  if (occ[INT_MAX] > 1) {
    for (int i = 0; i < n; i++)
      if (ret[i] == INT_MAX) {
        ret[i] = 1e9, occ[INT_MAX]--;
        if (occ[INT_MAX] == 0) ret[i] = (1 << 29) - 1;
      }
    for (int i = 0; i < n; i++) printf("%d ", ret[i]);
    printf("\n");
    return 0;
  }
  int orresult = 0;
  for (int i = 0; i < n; i++) {
    if (ret[i] == 0 || ret[i] == INT_MAX) continue;
    occ[ret[i]]--;
    if (occ[ret[i]]) {
      int tmp = ret[i], pow = 0;
      while (tmp) pow++, tmp >>= 1;
      ret[i] = (1 << (pow - 1)) - 1;
    }
    orresult |= ret[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 (ret[i] == INT_MAX)
      printf("%d ", tobe);
    else
      printf("%d ", ret[i]);
  }
  printf("\n");
  return 0;
}
