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 = 1e9 + 10, NUM = 1e9;
const int MN = 3e5 + 10;
vector<int> st[MN], en[MN];
int change_time[MN];
short tp[MN];
int arr[MN];
int L[MN], R[MN], val[MN], pl[MN], ans[MN];
int n, q;
int seg[MN << 2], seg2[MN << 2];
map<int, vector<int> > mp;
int ps_l[MN], ps_r[MN];
pair<int, int> Res;
void fail() {
  cout << "NO\n";
  exit(0);
}
int func(int a) {
  while (__builtin_popcount(a) > 1) a &= a - 1;
  return a - 1;
}
void upd(int id, int b, int e, int p, int val) {
  if (e - b == 1) {
    seg[id] = val;
    return;
  }
  int mid = b + e >> 1;
  if (p < mid)
    upd(id << 1, b, mid, p, val);
  else
    upd(id << 1 | 1, mid, e, p, val);
  seg[id] = min(seg[id << 1], seg[id << 1 | 1]);
}
int get(int id, int b, int e, int l, int r) {
  if (r <= b || e <= l) return NUM + 1;
  if (l <= b && e <= r) return seg[id];
  int mid = b + e >> 1;
  return min(get(id << 1, b, mid, l, r), get(id << 1 | 1, mid, e, l, r));
}
void upd2(int id, int b, int e, int p, int val) {
  if (e - b == 1) {
    seg2[id] = val;
    return;
  }
  int mid = b + e >> 1;
  if (p < mid)
    upd2(id << 1, b, mid, p, val);
  else
    upd2(id << 1 | 1, mid, e, p, val);
  seg2[id] = max(seg2[id << 1], seg2[id << 1 | 1]);
}
int get2(int id, int b, int e, int l, int r) {
  if (r <= b || e <= l) return 0;
  if (l <= b && e <= r) return seg2[id];
  int mid = b + e >> 1;
  return max(get2(id << 1, b, mid, l, r), get2(id << 1 | 1, mid, e, l, r));
}
void Make() {
  vector<int> My;
  for (int i = 0; i < q; ++i) upd(1, 0, q, i, NUM + 1);
  for (int i = 0; i < n; ++i) {
    for (auto x : st[i]) upd(1, 0, q, x, ans[x]);
    arr[i] = get(1, 0, q, 0, change_time[i]);
    if (arr[i] == NUM + 1) My.push_back(i), arr[i] = 0;
    for (auto x : en[i]) upd(1, 0, q, x, NUM + 1);
  }
  if (((int)(My).size()) > 1) {
    for (auto x : My) arr[x] = (1 << 29) - 1;
    arr[My[0]] = (1 << 29);
  }
  for (int i = 0; i < n; ++i) ps_l[i + 1] = ps_l[i] | arr[i];
  for (int i = n - 1; ~i; --i) ps_r[i] = ps_r[i + 1] | arr[i];
  for (int i = 0; i < n; ++i) upd2(1, 0, n, i, arr[i]);
  for (int i = 0; i < q; ++i) {
    if (tp[i] == 1) {
      if (get2(1, 0, n, L[i], R[i] + 1) != ans[i]) fail();
      mp[ans[i]].resize(0);
    } else
      upd2(1, 0, n, pl[i], val[i]);
  }
  for (int i = 0; i < n; ++i) mp[arr[i]].push_back(i);
  Res = {ps_l[n], -1};
  for (int i = 0; i < n; ++i) upd2(1, 0, n, i, arr[i]);
  for (int i = 0; i < q; ++i) {
    if (tp[i] == 1) {
      for (auto x : mp[ans[i]])
        if (max(get2(1, 0, n, L[i], x), get2(1, 0, n, x + 1, R[i] + 1)) ==
            ans[i]) {
          int V = ps_l[x] | ps_r[x + 1];
          V |= func(arr[x]);
          if (V > Res.first) Res = {V, x};
        }
    } else
      upd2(1, 0, n, pl[i], val[i]);
  }
  if (~Res.second) arr[Res.second] = func(arr[Res.second]);
  if (((int)(My).size()) == 1) {
    int ind = My[0], V = Res.first, Lim = NUM;
    for (int i = 29; ~i; --i)
      if (!((1 << i) & V)) {
        if (Lim >= (1 << i)) arr[ind] |= (1 << i), Lim -= (1 << i);
      }
  }
  cout << "YES\n";
  for (int i = 0; i < n; ++i) cout << arr[i] << ' ';
  cout << '\n';
}
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> q;
  fill(change_time, change_time + MN, q);
  for (int i = 0; i < q; ++i) {
    cin >> tp[i];
    if (tp[i] == 1) {
      cin >> L[i] >> R[i] >> ans[i];
      --L[i], --R[i];
      st[L[i]].push_back(i);
      en[R[i]].push_back(i);
    } else {
      cin >> pl[i] >> val[i], --pl[i];
      change_time[pl[i]] = min(change_time[pl[i]], i);
    }
  }
  Make();
  return 0;
}