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;
struct Bit {
  vector<int> tree, lazy;
  void init() {
    tree = vector<int>(4 * N, 1e9);
    lazy = vector<int>(4 * N, -1);
  }
  void prop(int l, int r, int n) {
    if (l != r && lazy[n] != -1) {
      if (lazy[n] < tree[2 * n]) tree[2 * n] = lazy[2 * n] = lazy[n];
      if (lazy[n] < tree[2 * n + 1])
        tree[2 * n + 1] = lazy[2 * n + 1] = lazy[n];
    }
    lazy[n] = -1;
  }
  void upd(int a, int b, int val, int l, int r, int n) {
    if (b < l || r < a) return;
    if (a <= l && r <= b) {
      if (val < tree[n]) tree[n] = lazy[n] = val;
      return;
    }
    prop(l, r, n);
    int m = (l + r) >> 1;
    upd(a, b, val, l, m, 2 * n);
    upd(a, b, val, m + 1, r, 2 * n + 1);
    tree[n] = max(tree[2 * n], tree[2 * n + 1]);
  }
  int quer(int a, int b, int l, int r, int n) {
    if (b < l || r < a) return -1;
    if (a <= l && r <= b) return tree[n];
    prop(l, r, n);
    int m = (l + r) >> 1;
    int L = quer(a, b, l, m, 2 * n);
    int R = quer(a, b, m + 1, r, 2 * n + 1);
    return max(L, R);
  }
} bit;
struct RMQ {
  vector<pair<int, int> > tree;
  void init() { tree = vector<pair<int, int> >(4 * N, pair<int, int>(-1, -1)); }
  void upd(int idx, pair<int, int> val, int l, int r, int n) {
    if (idx < l || r < idx) return;
    if (l == r) {
      tree[n] = val;
      return;
    }
    int m = (l + r) >> 1;
    upd(idx, val, l, m, 2 * n);
    upd(idx, val, m + 1, r, 2 * n + 1);
    tree[n] = max(tree[2 * n], tree[2 * n + 1]);
  }
  pair<int, int> quer(int a, int b, int l, int r, int n) {
    if (b < l || r < a) return pair<int, int>(-1, -1);
    if (a <= l && r <= b) return tree[n];
    int m = (l + r) >> 1;
    pair<int, int> L = quer(a, b, l, m, 2 * n);
    pair<int, int> R = quer(a, b, m + 1, r, 2 * n + 1);
    return max(L, R);
  }
} rmq;
struct query {
  int l, r, x;
};
vector<query> Q;
vector<int> mx, ans, X, chk;
map<int, int> dx;
vector<vector<int> > L;
priority_queue<pair<int, int> > pq;
int main() {
  scanf("%d %d", &N, &M);
  bit.init();
  rmq.init();
  mx = vector<int>(N, -1);
  bool poss = true;
  for (int i = 0; i < M; i++) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int l, r, x;
      scanf("%d %d %d", &l, &r, &x);
      l--;
      r--;
      if (rmq.quer(l, r, 0, N - 1, 1).first > x ||
          (rmq.quer(l, r, 0, N - 1, 1).first < x &&
           bit.quer(l, r, 0, N - 1, 1) < x)) {
        poss = false;
      }
      bit.upd(l, r, x, 0, N - 1, 1);
      if (rmq.quer(l, r, 0, N - 1, 1).first != x) Q.push_back({l, r, x});
    } else {
      int k, d;
      scanf("%d %d", &k, &d);
      k--;
      if (mx[k] == -1) mx[k] = bit.quer(k, k, 0, N - 1, 1);
      rmq.upd(k, pair<int, int>(d, 0), 0, N - 1, 1);
      Q.push_back({k, -1, -1});
    }
  }
  for (int i = 0; i < N; i++)
    if (mx[i] == -1) mx[i] = bit.quer(i, i, 0, N - 1, 1);
  for (int i = 0; i < N; i++) X.push_back(mx[i]);
  sort(X.begin(), X.end());
  X.resize(unique(X.begin(), X.end()) - X.begin());
  for (int i = 0; i < X.size(); i++) dx[X[i]] = i;
  L.resize(X.size());
  for (int i = 0; i < N; i++) L[dx[mx[i]]].push_back(i);
  ans = vector<int>(N, -1);
  chk = vector<int>(N, 1);
  for (int i = 0; i < Q.size(); i++) {
    if (Q[i].x == -1) {
      chk[Q[i].l] = 0;
      continue;
    }
    int l = Q[i].l, r = Q[i].r, x = dx[Q[i].x];
    bool f = false;
    for (int j = 0; j < L[x].size(); j++) {
      if (l <= L[x][j] && L[x][j] <= r && chk[L[x][j]]) {
        ans[L[x][j]] = X[x];
        f = true;
        break;
      }
    }
    poss &= f;
  }
  if (!poss) {
    printf("NO");
    return 0;
  }
  printf("YES\n");
  int mask = 0;
  for (int i = 0; i < N; i++) {
    if (ans[i] != -1)
      mask |= ans[i];
    else {
      ans[i] = 0;
      pq.push(pair<int, int>(mx[i], i));
    }
  }
  while (!pq.empty()) {
    pair<int, int> t = pq.top();
    pq.pop();
    for (int i = 30; i--;) {
      if (t.first & (1 << i)) {
        if (!(mask & (1 << i))) {
          ans[t.second] += (1 << i);
          t.first -= (1 << i);
          mask |= (1 << i);
        } else {
          ans[t.second] += (1 << i) - 1;
          mask |= (1 << i) - 1;
          t.first = 0;
        }
        if (t.first) pq.push(t);
        break;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    printf("%d ", ans[i]);
  }
}