#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5, inf = 2e9, OPT = 1 << 30, mninf = 1e9, LL = 30;
map<int, int> mp;
int RT[N], TP[N], L[N], R[N], K[N], X[N], D[N << 2], DD[N << 2], n, q, orrt,
    bst;
void minm(int& a, int d) { a = min(a, d); }
void maxm(int& a, int d) { a = min(a, d); }
void add(int s, int e, int d, int id = 1, int l = 0, int r = n) {
  if (l >= e || r <= s) return;
  if (l >= s && r <= e) {
    minm(D[id], d);
    return;
  }
  int mid = ((l + r) >> 1);
  add(s, e, d, (id << 1), l, mid);
  add(s, e, d, (id << 1 | 1), mid, r);
}
int get(int ind, int id = 1, int l = 0, int r = n) {
  if (r - l < 2) return (D[id]);
  int mid = ((l + r) >> 1);
  if (ind < mid) return (min(D[id], get(ind, (id << 1), l, mid)));
  return (min(D[id], get(ind, (id << 1 | 1), mid, r)));
}
void buildD(int id = 1, int l = 0, int r = n) {
  if (r - l < 2) {
    DD[id] = RT[l];
    return;
  }
  int mid = ((l + r) >> 1);
  buildD((id << 1), l, mid);
  buildD((id << 1 | 1), mid, r);
  DD[id] = max(DD[(id << 1)], DD[(id << 1 | 1)]);
}
void addD(int ind, int d, int id = 1, int l = 0, int r = n) {
  if (r - l < 2) {
    DD[id] = d;
    return;
  }
  int mid = ((l + r) >> 1);
  if (ind < mid)
    addD(ind, d, (id << 1), l, mid);
  else
    addD(ind, d, (id << 1 | 1), mid, r);
  DD[id] = max(DD[(id << 1)], DD[(id << 1 | 1)]);
}
int getD(int s, int e, int id = 1, int l = 0, int r = n) {
  if (l >= e || r <= s) return (-inf);
  if (l >= s && r <= e) return (DD[id]);
  int mid = ((l + r) >> 1);
  return (
      max(getD(s, e, (id << 1), l, mid), getD(s, e, (id << 1 | 1), mid, r)));
}
int main() {
  fill(D, D + (N << 2), inf);
  memset(RT, -1, sizeof(RT));
  scanf("%d %d", &n, &q);
  for (int i = 0; i < q; i++) {
    scanf("%d", &TP[i]);
    if (TP[i] == 1) {
      scanf("%d %d %d", &L[i], &R[i], &X[i]);
      L[i]--;
      R[i]--;
      add(L[i], R[i] + 1, X[i]);
      continue;
    }
    scanf("%d %d", &K[i], &X[i]);
    K[i]--;
    if (!(~RT[K[i]])) RT[K[i]] = get(K[i]);
  }
  for (int i = 0; i < n; i++)
    if (!(~RT[i])) RT[i] = get(i);
  buildD();
  for (int i = 0; i < q; i++) {
    if (TP[i] == 1) {
      if (getD(L[i], R[i] + 1) ^ X[i]) return !printf("NO");
      continue;
    }
    addD(K[i], X[i]);
  }
  if (*min_element(RT, RT + n) < 0) return !printf("NO");
  printf("YES\n");
  for (int i = 0; i < n; i++) mp[RT[i]]++;
  if (mp[inf] > 1) {
    for (int i = 0; i < n; i++)
      if (RT[i] == inf) {
        if (!(--mp[inf]))
          RT[i] = (OPT - 1) ^ mninf;
        else
          RT[i] = mninf;
      }
    for (int i = 0; i < n; i++) printf("%d ", RT[i]);
    return (0);
  }
  for (int i = 0; i < n; i++)
    if (RT[i] && (RT[i] ^ inf)) {
      mp[RT[i]]--;
      if (mp[RT[i]]) {
        int gt = log2(RT[i]);
        RT[i] = (1 << gt) - 1;
      }
      orrt |= RT[i];
    }
  for (int i = LL - 1; ~i; i--)
    if (!(orrt & (1 << i))) {
      if (bst + (1 << i) <= mninf) bst += (1 << i);
    }
  for (int i = 0; i < n; i++) {
    if (RT[i] ^ inf)
      printf("%d ", RT[i]);
    else
      printf("%d ", bst);
  }
}
