Problem: Zane once had a good sequence a consisting of n integers a1, a2, ..., an — but he has lost it.

A sequence is said to be good if and only if all of its integers are non-negative and do not exceed 109 in value.

<image>

However, Zane remembers having played around with his sequence by applying m operations to it.

There are two types of operations:

1. Find the maximum value of integers with indices i such that l ≤ i ≤ r, given l and r.

2. Assign d as the value of the integer with index k, given k and d.

After he finished playing, he restored his sequence to the state it was before any operations were applied. That is, sequence a was no longer affected by the applied type 2 operations. Then, he lost his sequence at some time between now and then.

Fortunately, Zane remembers all the operations and the order he applied them to his sequence, along with the distinct results of all type 1 operations. Moreover, among all good sequences that would produce the same results when the same operations are applied in the same order, he knows that his sequence a has the greatest cuteness.

We define cuteness of a sequence as the bitwise OR result of all integers in such sequence. For example, the cuteness of Zane's sequence a is a1 OR a2 OR ... OR an.

Zane understands that it might not be possible to recover exactly the lost sequence given his information, so he would be happy to get any good sequence b consisting of n integers b1, b2, ..., bn that:

1. would give the same results when the same operations are applied in the same order, and

2. has the same cuteness as that of Zane's original sequence a.

If there is such a sequence, find it. Otherwise, it means that Zane must have remembered something incorrectly, which is possible.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 3·105) — the number of integers in Zane's original sequence and the number of operations that have been applied to the sequence, respectively.

The i-th of the following m lines starts with one integer ti (<image>) — the type of the i-th operation.

If the operation is type 1 (ti = 1), then three integers li, ri, and xi follow (1 ≤ li ≤ ri ≤ n, 0 ≤ xi ≤ 109) — the leftmost index to be considered, the rightmost index to be considered, and the maximum value of all integers with indices between li and ri, inclusive, respectively.

If the operation is type 2 (ti = 2), then two integers ki and di follow (1 ≤ ki ≤ n, 0 ≤ di ≤ 109) — meaning that the integer with index ki should become di after this operation.

It is guaranteed that xi ≠ xj for all pairs (i, j) where 1 ≤ i < j ≤ m and ti = tj = 1.

The operations are given in the same order they were applied. That is, the operation that is given first was applied first, the operation that is given second was applied second, and so on.

Output

If there does not exist a valid good sequence, print "NO" (without quotation marks) in the first line.

Otherwise, print "YES" (without quotation marks) in the first line, and print n space-separated integers b1, b2, ..., bn (0 ≤ bi ≤ 109) in the second line.

If there are multiple answers, print any of them.

Examples

Input

5 4
1 1 5 19
1 2 5 1
2 5 100
1 1 5 100


Output

YES
19 0 0 0 1


Input

5 2
1 1 5 0
1 1 5 100


Output

NO

Note

In the first sample, it is easy to verify that this good sequence is valid. In particular, its cuteness is 19 OR 0 OR 0 OR 0 OR 1 =  19.

In the second sample, the two operations clearly contradict, so there is no such good sequence.

Solution (in CPP):

Solution:
#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;
}