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;
const int INF = 1000 * 1000 * 1000 + 10;
const int LIM = 1000 * 1000 * 1000;
const int N = 300 * 1000 + 10;
const int OPT = (1 << 30) - 1;
using UI = unsigned int;
bool satisf[N];
set<int> must_have;
int tp[N];
int l[N];
int r[N];
int x[N];
int earliest[N];
int n, m;
int ans[N];
struct Tree {
  vector<int> t;
  int size;
  Tree(int s) : t(4 * s + 10, INF), size(s) {}
  void put(int pos, int val) { put(0, 0, size - 1, pos, val); }
  int get(int l, int r) { return get(0, 0, size - 1, l, r); }
  void put(int i, int tl, int tr, int pos, int val) {
    if (tl == tr) {
      t[i] = val;
      return;
    }
    int m = (tl + tr) / 2;
    if (pos <= m)
      put(2 * i + 1, tl, m, pos, val);
    else
      put(2 * i + 2, m + 1, tr, pos, val);
    t[i] = min(t[2 * i + 1], t[2 * i + 2]);
  }
  int get(int i, int tl, int tr, int l, int r) {
    if (l == tl && r == tr) return t[i];
    int ml = INF;
    int mr = INF;
    int m = (tl + tr) / 2;
    if (l <= m) ml = get(2 * i + 1, tl, m, l, min(r, m));
    if (r > m) mr = get(2 * i + 2, m + 1, tr, max(m + 1, l), r);
    return min(ml, mr);
  }
};
void gen_satisf() {
  map<int, set<int> > pos;
  vector<int> cur(n, -1);
  for (int i = 0; i < m; i++) {
    if (tp[i] == 2) {
      if (cur[l[i]] != -1) pos[cur[l[i]]].erase(l[i]);
      cur[l[i]] = x[i];
      pos[cur[l[i]]].insert(l[i]);
    } else {
      if (!pos.count(x[i])) continue;
      auto it = pos[x[i]].lower_bound(l[i]);
      if (it != pos[x[i]].end() && *it <= r[i]) satisf[i] = true;
    }
  }
}
vector<int> open_at[N];
vector<int> close_at[N];
int bound[N];
void gen_bounds() {
  fill(bound, bound + n, INF);
  for (int i = 0; i < m; i++) {
    if (tp[i] == 1) {
      open_at[l[i]].push_back(i);
      close_at[r[i]].push_back(i);
      if (!satisf[i]) must_have.insert(x[i]);
    }
  }
  Tree tree(m);
  for (int i = 0; i < n; i++) {
    for (int idx : open_at[i]) tree.put(idx, x[idx]);
    int r = min(m - 1, earliest[i]);
    bound[i] = tree.get(0, r);
    for (auto idx : close_at[i]) tree.put(idx, INF);
  }
}
bool check() {
  Tree tree(n);
  for (int i = 0; i < n; i++) tree.put(i, -ans[i]);
  for (int i = 0; i < m; i++)
    if (tp[i] == 2)
      tree.put(l[i], -x[i]);
    else if (tree.get(l[i], r[i]) != -x[i])
      return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cin >> n >> m;
  fill(earliest, earliest + n, INF);
  for (int i = 0; i < m; i++) {
    cin >> tp[i];
    if (tp[i] == 1) {
      cin >> l[i] >> r[i] >> x[i];
      l[i]--;
      r[i]--;
    } else {
      cin >> l[i] >> x[i];
      l[i]--;
      earliest[l[i]] = min(earliest[l[i]], i);
    }
  }
  gen_satisf();
  gen_bounds();
  UI remaining = OPT;
  vector<pair<int, int> > rest;
  for (int i = 0; i < n; i++) {
    if (must_have.count(bound[i])) {
      must_have.erase(bound[i]);
      ans[i] = bound[i];
      remaining &= ~UI(ans[i]);
    } else {
      rest.push_back(pair<int, int>(-bound[i], i));
    }
  }
  sort(rest.begin(), rest.end());
  for (auto p : rest) {
    int i = p.second;
    int lim = min(LIM, bound[i]);
    UI cur = 0;
    for (int j = 29; j >= 0; j--)
      if ((remaining & (1 << j)) && cur + (1 << j) <= lim) cur += (1 << j);
    remaining &= ~cur;
    ans[i] = cur;
  }
  if (!check()) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  puts("");
  return 0;
}