#include <bits/stdc++.h>
using namespace std;
int n, m;
typedef struct QUERYtype {
  int l, r, x;
} QUERY;
template <typename T>
struct SEG {
  typedef const T (*SEG_OP)(const T&, const T&);
  typedef void (*SEG_UPL)(T&, const T&);
  typedef void (*SEG_UPD)(T&, const T&, int l, int r);
  int size, m;
  T *data, *lazy, def;
  SEG_OP op;
  SEG_UPL upl;
  SEG_UPD upd;
};
inline const int imin(const int& x, const int& y) { return min(x, y); }
inline const int imax(const int& x, const int& y) { return max(x, y); }
inline void icmp_min(int& old_value, const int& new_value) {
  old_value = min(old_value, new_value);
}
inline void icmp_mind(int& old_value, const int& new_value, int l, int r) {
  old_value = min(old_value, new_value);
}
template <typename T>
void SEG_create(SEG<T>*& seg, T* a, int n, typename SEG<T>::SEG_OP op,
                typename SEG<T>::SEG_UPL upl, typename SEG<T>::SEG_UPD upd,
                const T& def, int i = 1) {
  if (i == 1) {
    seg = (SEG<T>*)malloc(sizeof(SEG<T>));
    for (seg->m = 1; seg->m < n; seg->m <<= 1)
      ;
    seg->size = n;
    seg->op = op;
    seg->upl = upl;
    seg->upd = upd;
    seg->def = def;
    seg->data = (T*)malloc(2 * seg->m * sizeof(T));
    seg->lazy = (T*)malloc(2 * seg->m * sizeof(T));
    for (int i = 0; i < 2 * seg->m; i++) seg->lazy[i] = seg->def;
  }
  if (n == 1)
    seg->data[i] = *a;
  else {
    int mid = n / 2;
    SEG_create(seg, a, mid, op, upl, upd, def, 2 * i);
    SEG_create(seg, a + mid, n - mid, op, upl, upd, def, 2 * i + 1);
    seg->data[i] = op(seg->data[2 * i], seg->data[2 * i + 1]);
  }
}
template <typename T>
void SEG_destroy(SEG<T>*& seg) {
  free(seg->data);
  free(seg->lazy);
  free(seg);
  seg = NULL;
}
template <typename T>
inline void SEG_push_lazy(SEG<T>*& seg, int start, int end, int mid, int i) {
  if (seg->lazy[i] != seg->def) {
    seg->upl(seg->lazy[i * 2], seg->lazy[i]);
    seg->upl(seg->lazy[i * 2 + 1], seg->lazy[i]);
    seg->upd(seg->data[i * 2], seg->lazy[i], start, mid);
    seg->upd(seg->data[i * 2 + 1], seg->lazy[i], mid, end);
    seg->lazy[i] = seg->def;
  }
}
template <typename T>
void SEG_update(SEG<T>*& seg, int l, int r, const T& val, int start = -1,
                int end = -1, int i = 1) {
  if (i == 1) start = 0, end = seg->size;
  if (r <= start || l >= end)
    ;
  else if (l <= start && r >= end) {
    seg->upl(seg->lazy[i], val);
    seg->upd(seg->data[i], val, start, end);
  } else {
    int mid = (start + end) / 2;
    SEG_push_lazy(seg, start, end, mid, i);
    SEG_update(seg, l, r, val, start, mid, i * 2);
    SEG_update(seg, l, r, val, mid, end, i * 2 + 1);
    seg->data[i] = seg->op(seg->data[i * 2], seg->data[i * 2 + 1]);
  }
}
template <typename T>
void SEG_update_special(SEG<T>*& seg, int idx, const T& val, int start = -1,
                        int end = -1, int i = 1) {
  if (i == 1) start = 0, end = seg->size;
  if (start + 1 == end)
    seg->data[i] = val;
  else {
    int mid = (start + end) / 2;
    SEG_push_lazy(seg, start, end, mid, i);
    if (idx < mid)
      SEG_update_special(seg, idx, val, start, mid, i * 2);
    else
      SEG_update_special(seg, idx, val, mid, end, i * 2 + 1);
    seg->data[i] = seg->op(seg->data[i * 2], seg->data[i * 2 + 1]);
  }
}
template <typename T>
const T SEG_query(SEG<T>*& seg, int l, int r, int start = -1, int end = -1,
                  int i = 1) {
  if (i == 1) start = 0, end = seg->size;
  if (r <= start || l >= end)
    return seg->def;
  else if (l <= start && r >= end)
    return seg->data[i];
  else {
    int mid = (start + end) / 2;
    SEG_push_lazy(seg, start, end, mid, i);
    return seg->op(SEG_query(seg, l, r, start, mid, 2 * i),
                   SEG_query(seg, l, r, mid, end, 2 * i + 1));
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  vector<QUERY> q;
  int l, r, k, d, x, t;
  int arr[n], amax[n];
  SEG<int>* seg;
  for (int i = 0; i < n; i++) arr[i] = 1000000000 + 1, amax[i] = 1000000000 + 2;
  SEG_create(seg, arr, n, &imin, &icmp_min, &icmp_mind, 1000000000 + 1);
  for (int i = 0; i < m; i++) {
    cin >> t;
    if (t == 1) {
      cin >> l >> r >> x;
      q.push_back({.l = l - 1, .r = r, .x = x});
      SEG_update(seg, l - 1, r, x);
    } else {
      cin >> k >> d;
      q.push_back({.l = -1, .r = k - 1, .x = d});
      if (amax[k - 1] == 1000000000 + 2) amax[k - 1] = SEG_query(seg, k - 1, k);
      SEG_update_special(seg, k - 1, d);
    }
  }
  for (int i = 0; i < n; i++)
    if (amax[i] == 1000000000 + 2) amax[i] = SEG_query(seg, i, i + 1);
  SEG_destroy(seg);
  SEG_create(seg, amax, n, &imax, &icmp_min, &icmp_mind, -1000000000);
  bool impossible = false;
  for (auto qi : q) {
    if (qi.l == -1)
      SEG_update_special(seg, qi.r, qi.x);
    else if (SEG_query(seg, qi.l, qi.r) != qi.x) {
      impossible = true;
      break;
    }
  }
  SEG_destroy(seg);
  if (impossible)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    auto cmp = [&amax](int i, int j) {
      if (amax[i] != amax[j])
        return amax[i] > amax[j];
      else
        return i < j;
    };
    int idx[n];
    for (int i = 0; i < n; i++) idx[i] = i;
    sort(idx, idx + n, cmp);
    if (n >= 2 && amax[idx[0]] == 1000000000 + 1 &&
        amax[idx[1]] == 1000000000 + 1) {
      amax[idx[0]] = (1 << 29) - 1;
    } else {
      for (int i = amax[idx[0]] == 1000000000 + 1 ? 1 : 0; i < n - 1; i++) {
        if (amax[idx[i]] == amax[idx[i + 1]]) {
          int val = 0;
          while (amax[idx[i]] != 0) val++, amax[idx[i]] >>= 1;
          if (val != 0) amax[idx[i]] = (1 << (val - 1)) - 1;
          i++;
          while (i < n - 1 && amax[idx[i]] == amax[idx[i + 1]]) i++;
          i--;
        }
      }
      if (amax[idx[0]] == 1000000000 + 1) {
        int bitor_ans = 0;
        for (int i = 1; i < n; i++)
          bitor_ans |=
              amax[idx[i]] == 1000000000 + 1 ? 1000000000 : amax[idx[i]];
        amax[idx[0]] = 0;
        for (int val = 1 << 29; val != 0; val >>= 1) {
          if ((amax[idx[0]] | val) <= 1000000000 && (bitor_ans & val) == 0)
            amax[idx[0]] |= val;
        }
      }
    }
    for (int i = 0; i < n; i++)
      cout << (amax[i] == 1000000000 + 1 ? 1000000000 : amax[i]) << " ";
    cout << endl;
  }
  return 0;
}
