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 edge {
  int u, v;
  long long w;
};
int MOD;
const int _MOD = 1000000009;
long long INF = 1e18;
double EPS = 1e-10;
struct segtree {
  segtree *lch, *rch;
  int l, r;
  long long x, dx;
  segtree(int _l, int _r) : l(_l), r(_r), x(INF), dx(0) {
    if (r - l == 1) return;
    int m = (l + r) / 2;
    lch = new segtree(l, m);
    rch = new segtree(m, r);
  }
  void denpan() {
    lch->lazy(x, dx);
    rch->lazy(x, dx);
    x = INF;
    dx = 0;
  }
  void lazy(long long _x, long long _dx) {
    x = min(x, _x - dx);
    dx += _dx;
  }
  void update(int _l, int _r, long long _x, long long _dx) {
    if (r <= _l || _r <= l) return;
    if (_l <= l && r <= _r) {
      lazy(_x, _dx);
      return;
    }
    denpan();
    lch->update(_l, _r, _x, _dx);
    rch->update(_l, _r, _x, _dx);
  }
  long long get(int i) {
    if (r - l == 1) return x + dx;
    denpan();
    int m = (l + r) / 2;
    if (l <= i && i < m) return lch->get(i);
    if (m <= i && i < r) return rch->get(i);
  }
};
struct _segtree {
  _segtree *lch, *rch;
  int l, r;
  long long x, dx;
  _segtree(int _l, int _r) : l(_l), r(_r), x(-1), dx(0) {
    if (r - l == 1) return;
    int m = (l + r) / 2;
    lch = new _segtree(l, m);
    rch = new _segtree(m, r);
  }
  void denpan() {
    lch->lazy(dx);
    rch->lazy(dx);
    dx = 0;
  }
  void merge() { x = max(lch->x + lch->dx, rch->x + rch->dx); }
  void lazy(long long _dx) { dx += _dx; }
  void add(int _l, int _r, long long _dx) {
    if (r <= _l || _r <= l) return;
    if (_l <= l && r <= _r) {
      dx += _dx;
      return;
    }
    denpan();
    lch->add(_l, _r, _dx);
    rch->add(_l, _r, _dx);
    merge();
  }
  long long mx(int _l, int _r) {
    if (r <= _l || _r <= l) return -INF;
    if (_l <= l && r <= _r) return x + dx;
    denpan();
    merge();
    return max(lch->mx(_l, _r), rch->mx(_l, _r));
  }
};
int main() {
  int N, Q;
  cin >> N >> Q;
  vector<int> t(Q), l(Q), r(Q), x(Q);
  for (int k = 0; k < Q; k++) {
    scanf("%d", &t[k]);
    if (t[k] == 1) scanf("%d%d%d", &l[k], &r[k], &x[k]);
    if (t[k] == 2) scanf("%d%d", &l[k], &x[k]);
    l[k]--;
  }
  segtree* st = new segtree(0, N);
  for (int k = Q - 1; k >= 0; k--) {
    if (t[k] == 1) st->update(l[k], r[k], x[k], 0);
    if (t[k] == 2) st->update(l[k], l[k] + 1, INF / 10, INT_MAX);
  }
  vector<long long> a(N);
  for (int i = 0; i < N; i++) a[i] = st->get(i);
  _segtree* _st = new _segtree(0, N);
  for (int i = 0; i < N; i++) _st->add(i, i + 1, a[i] + 1);
  vector<long long> a0 = a;
  for (int k = 0; k < Q; k++) {
    if (t[k] == 1) {
      if (_st->mx(l[k], r[k]) != x[k]) {
        cout << "NO" << endl;
        return 0;
      }
    }
    if (t[k] == 2) {
      int i = l[k];
      _st->add(i, i + 1, x[k] - a[i]);
      a[i] = x[k];
    }
  }
  set<long long> S;
  _segtree* _st2 = new _segtree(0, N);
  for (int i = 0; i < N; i++) a[i] = -1;
  for (int k = 0; k < Q; k++) {
    if (t[k] == 1) {
      if (_st2->mx(l[k], r[k]) != x[k]) S.insert(x[k]);
    }
    if (t[k] == 2) {
      int i = l[k];
      _st2->add(i, i + 1, x[k] - a[i]);
      a[i] = x[k];
    }
  }
  for (int i = 0; i < N; i++) a0[i] = min(a0[i], (long long)1e9 + 1);
  priority_queue<pair<int, int> > pq;
  vector<long long> ans(N);
  long long cute = 0;
  for (int i = 0; i < N; i++) {
    if (S.count(a0[i])) {
      S.erase(a0[i]);
      ans[i] = a0[i];
      cute |= a0[i];
    } else if (a0[i])
      pq.push(pair<int, int>(min(a0[i], (long long)1e9), i));
  }
  for (int i = 0; i < N; i++) a0[i] = min(a0[i], (long long)1e9);
  while (pq.size()) {
    int x = pq.top().first;
    int i = pq.top().second;
    pq.pop();
    int k;
    for (k = 30; k >= 0; k--)
      if (!(cute >> k & 1) && (x >= (1 << k))) break;
    if (k == -1) continue;
    cute |= 1 << k;
    pq.push(pair<int, int>(x - (1 << k), i));
    ans[i] += 1 << k;
  }
  cout << "YES" << endl;
  for (int i = 0; i < N; i++) printf("%d ", ans[i]);
  cout << endl;
}