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;
struct segtree2 {
  int seg[512 * 1024 * 2];
  int mum;
  void init(int n) {
    mum = 1;
    while (mum < n) mum <<= 1;
    for (int i = 0; i < mum * 2; i++) seg[i] = -1;
  }
  void add(int k, int x) {
    k += mum - 1;
    seg[k] = x;
    while (k > 0) {
      k = (k - 1) / 2;
      seg[k] = max(seg[k * 2 + 1], seg[k * 2 + 2]);
    }
  }
  int get(int a, int b, int k, int l, int r) {
    if (b <= l || r <= a) return -1;
    if (a <= l && r <= b)
      return seg[k];
    else {
      int vl = get(a, b, k * 2 + 1, l, (l + r) / 2);
      int vr = get(a, b, k * 2 + 2, (l + r) / 2, r);
      return max(vl, vr);
    }
  }
  int get(int a, int b) { return get(a, b, 0, 0, mum); }
};
struct segtree1 {
  int seg[512 * 1024 * 2];
  int mum;
  void init(int n) {
    mum = 1;
    while (mum < n) mum <<= 1;
    for (int i = 0; i < mum * 2; i++) seg[i] = 1000000005;
  }
  void update(int a, int b, int k, int l, int r, int v) {
    if (b <= l || r <= a) return;
    if (a <= l && r <= b)
      seg[k] = min(seg[k], v);
    else {
      update(a, b, k * 2 + 1, l, (l + r) / 2, v);
      update(a, b, k * 2 + 2, (l + r) / 2, r, v);
    }
  }
  void update(int a, int b, int v) { update(a, b, 0, 0, mum, v); }
  void pass(int k) {
    seg[k * 2 + 1] = min(seg[k * 2 + 1], seg[k]);
    seg[k * 2 + 2] = min(seg[k * 2 + 2], seg[k]);
    seg[k] = 1000000005;
  }
  void erase(int x) {
    int l = 0, r = mum, k = 0;
    while (l + 1 < r) {
      pass(k);
      int m = (l + r) / 2;
      if (x < m) {
        r = m;
        k = k * 2 + 1;
      } else {
        l = m;
        k = k * 2 + 2;
      }
    }
    seg[k] = 1000000005;
  }
  int get(int k) {
    k += mum - 1;
    int ret = seg[k];
    while (k > 0) {
      k = (k - 1) / 2;
      ret = min(ret, seg[k]);
    }
    return ret;
  }
};
segtree1 s1;
segtree2 s2;
int L[300005], R[300005], X[300005];
int pos[300005], dt[300005];
int tp[300005];
int mx[300005], nowA[300005];
set<int> st[300005];
set<int>::iterator it;
vector<int> vec[40];
bool use[300005];
bool ng[300005];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  s1.init(n + 2);
  s2.init(n + 2);
  memset(nowA, -1, sizeof(nowA));
  memset(use, false, sizeof(use));
  for (int i = 0; i < m; i++) {
    scanf("%d", &tp[i]);
    if (tp[i] == 1) {
      scanf("%d %d %d", &L[i], &R[i], &X[i]);
      L[i]--, R[i]--;
      s1.update(L[i], R[i] + 1, X[i]);
      int gt = s2.get(L[i], R[i] + 1);
      if (gt > X[i]) {
        puts("NO");
        return 0;
      }
      use[i] = gt == X[i];
    } else {
      scanf("%d %d", &pos[i], &dt[i]);
      pos[i]--;
      int gt = s1.get(pos[i]);
      gt = min(gt, 1000000000);
      if (nowA[pos[i]] == -1) mx[pos[i]] = gt;
      nowA[pos[i]] = dt[i];
      s2.add(pos[i], dt[i]);
    }
  }
  for (int i = 0; i < n; i++) {
    if (nowA[i] == -1) {
      mx[i] = s1.get(i);
      mx[i] = min(mx[i], 1000000000);
    }
  }
  vector<int> vx;
  for (int i = 0; i < n; i++) vx.push_back(mx[i]);
  sort(vx.begin(), vx.end());
  vx.erase(unique(vx.begin(), vx.end()), vx.end());
  for (int i = 0; i < n; i++) {
    mx[i] = lower_bound(vx.begin(), vx.end(), mx[i]) - vx.begin();
    st[mx[i]].insert(i);
  }
  for (int i = 0; i < m; i++) {
    if (tp[i] == 1 && !use[i]) {
      int t = lower_bound(vx.begin(), vx.end(), X[i]) - vx.begin();
      if (t == vx.size() || vx[t] != X[i]) {
        puts("NO");
        return 0;
      }
      it = st[t].lower_bound(L[i]);
      if (it == st[t].end() || *it > R[i]) {
        puts("NO");
        return 0;
      }
      int to = *it;
      it++;
      if (it == st[t].end() || *it > R[i]) {
        ng[to] = true;
      }
    } else {
      int v = pos[i];
      st[mx[v]].erase(v);
    }
  }
  for (int i = 0; i < n; i++) {
    mx[i] = vx[mx[i]];
    int vl = mx[i];
    if (vl > 0) {
      int cnt = 0;
      while (vl > 0) {
        vl /= 2;
        cnt++;
      }
      vec[cnt - 1].push_back(i);
    }
  }
  int ret = 0;
  for (int i = 40 - 1; i >= 0; i--) {
    if (vec[i].empty()) continue;
    if (ret >> i & 1) {
      bool U = true;
      for (int j = 0; j < vec[i].size(); j++) {
        int v = vec[i][j];
        if (!ng[v] && U) {
          mx[v] = ((mx[v] >> (i + 1)) << (i + 1)) + (1 << i) - 1;
          U = false;
        }
        ret |= mx[v];
      }
      if (!U) break;
    } else {
      if (vec[i].size() == 1) {
        int v = vec[i][0];
        if (!ng[v]) {
          int zan = mx[v] - ((mx[v] >> i) << i);
          ret |= 1 << i;
          if (zan > 0) {
            int vl = zan, cnt = 0;
            while (vl > 0) {
              vl /= 2;
              cnt++;
            }
            vec[cnt - 1].push_back(v);
          }
        } else
          ret |= mx[v];
      } else {
        bool up = false;
        for (int j = 0; j < vec[i].size(); j++) {
          int v = vec[i][j];
          up |= !ng[v];
        }
        if (up) {
          for (int j = 0; j < vec[i].size(); j++) {
            int v = vec[i][j];
            if (!ng[v]) {
              mx[v] = ((mx[v] >> (i + 1)) << (i + 1)) + (1 << i) - 1;
              break;
            }
          }
          ret |= (1 << (i + 1)) - 1;
          break;
        } else {
          for (int j = 0; j < vec[i].size(); j++) {
            int v = vec[i][j];
            ret |= mx[v];
          }
        }
      }
    }
  }
  puts("YES");
  for (int i = 0; i < n; i++) {
    if (i != 0) printf(" ");
    printf("%d", mx[i]);
  }
  puts("");
  return 0;
}