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>
template <typename T>
inline T max(T a, T b) {
  return a > b ? a : b;
}
template <typename T>
inline T min(T a, T b) {
  return a < b ? a : b;
}
template <typename T>
inline T abs(T a) {
  return a > 0 ? a : -a;
}
template <typename T>
inline bool repr(T &a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T>
inline bool repl(T &a, T b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline T gcd(T a, T b) {
  T t;
  if (a < b) {
    while (a) {
      t = a;
      a = b % a;
      b = t;
    }
    return b;
  } else {
    while (b) {
      t = b;
      b = a % b;
      a = t;
    }
    return a;
  }
}
template <typename T>
inline T sqr(T x) {
  return x * x;
}
struct Cg {
  inline char operator()() { return getchar(); }
};
struct Cp {
  inline void operator()(char x) { putchar(x); }
};
inline bool IS(char x) { return x == 10 || x == 13 || x == ' '; }
template <typename T>
struct Fr {
  T P;
  inline Fr &operator,(int &x) {
    x = 0;
    char t = P();
    while ((t < '0' || t > '9') && t != '-') t = P();
    bool f = 0;
    if (t == '-') t = P(), f = 1;
    x = t - '0';
    for (t = P(); t >= '0' && t <= '9'; t = P()) x = x * 10 + t - '0';
    if (f) x = -x;
    return *this;
  }
  inline operator int() {
    int x;
    *this, x;
    return x;
  }
  inline Fr &operator,(long long &x) {
    x = 0;
    char t = P();
    while ((t < '0' || t > '9') && t != '-') t = P();
    bool f = 0;
    if (t == '-') t = P(), f = 1;
    x = t - '0';
    for (t = P(); t >= '0' && t <= '9'; t = P()) x = x * 10 + t - '0';
    if (f) x = -x;
    return *this;
  }
  inline operator long long() {
    long long x;
    *this, x;
    return x;
  }
  inline Fr &operator,(char &x) {
    for (x = P(); IS(x); x = P())
      ;
    return *this;
  }
  inline operator char() {
    char x;
    *this, x;
    return x;
  }
  inline Fr &operator,(char *x) {
    char t = P();
    for (; IS(t); t = P())
      ;
    if (~t) {
      for (; !IS(t) && ~t; t = P()) *x++ = t;
    }
    *x++ = 0;
    return *this;
  }
  inline Fr &operator,(double &x) {
    x = 0;
    char t = P();
    while ((t < '0' || t > '9') && t != '-') t = P();
    bool f = 0;
    if (t == '-') t = P(), f = 1;
    x = t - '0';
    for (t = P(); t >= '0' && t <= '9'; t = P()) x = x * 10 + t - '0';
    if (t == '.') {
      double u = 0.1;
      for (t = P(); t >= '0' && t <= '9'; t = P(), u *= 0.1) x += u * (t - '0');
    }
    if (f) x = -x;
    return *this;
  }
  inline operator double() {
    double x;
    *this, x;
    return x;
  }
  inline Fr &operator,(long double &x) {
    x = 0;
    char t = P();
    while ((t < '0' || t > '9') && t != '-') t = P();
    bool f = 0;
    if (t == '-') t = P(), f = 1;
    x = t - '0';
    for (t = P(); t >= '0' && t <= '9'; t = P()) x = x * 10 + t - '0';
    if (t == '.') {
      double u = 0.1;
      for (t = P(); t >= '0' && t <= '9'; t = P(), u *= 0.1) x += u * (t - '0');
    }
    if (f) x = -x;
    return *this;
  }
  inline operator long double() {
    long double x;
    *this, x;
    return x;
  }
  inline Fr &operator,(unsigned int &x) {
    x = 0;
    char t = P();
    while (t < '0' || t > '9') t = P();
    x = t - '0';
    for (t = P(); t >= '0' && t <= '9'; t = P()) x = x * 10 + t - '0';
    return *this;
  }
  inline operator unsigned int() {
    unsigned int x;
    *this, x;
    return x;
  }
  inline Fr &operator,(unsigned long long &x) {
    x = 0;
    char t = P();
    while (t < '0' || t > '9') t = P();
    x = t - '0';
    for (t = P(); t >= '0' && t <= '9'; t = P()) x = x * 10 + t - '0';
    return *this;
  }
  inline operator unsigned long long() {
    unsigned long long x;
    *this, x;
    return x;
  }
};
Fr<Cg> in;
template <typename T>
struct Fw {
  T P;
  inline Fw &operator,(int x) {
    if (x) {
      if (x < 0) P('-'), x = -x;
      char s[10], c = 0;
      while (x) s[c++] = x % 10 + '0', x /= 10;
      while (c--) P(s[c]);
    } else
      P('0');
    return *this;
  }
  inline Fw &operator()(int x) {
    if (x) {
      if (x < 0) P('-'), x = -x;
      char s[10], c = 0;
      while (x) s[c++] = x % 10 + '0', x /= 10;
      while (c--) P(s[c]);
    } else
      P('0');
    return *this;
  }
  inline Fw &operator,(unsigned int x) {
    if (x) {
      char s[10], c = 0;
      while (x) s[c++] = x % 10 + '0', x /= 10;
      while (c--) P(s[c]);
    } else
      P('0');
    return *this;
  }
  inline Fw &operator()(unsigned int x) {
    if (x) {
      char s[10], c = 0;
      while (x) s[c++] = x % 10 + '0', x /= 10;
      while (c--) P(s[c]);
    } else
      P('0');
    return *this;
  }
  inline Fw &operator,(long long x) {
    if (x) {
      if (x < 0) P('-'), x = -x;
      char s[19], c = 0;
      while (x) s[c++] = x % 10 + '0', x /= 10;
      while (c--) P(s[c]);
    } else
      P('0');
    return *this;
  }
  inline Fw &operator()(long long x) {
    if (x) {
      if (x < 0) P('-'), x = -x;
      char s[19], c = 0;
      while (x) s[c++] = x % 10 + '0', x /= 10;
      while (c--) P(s[c]);
    } else
      P('0');
    return *this;
  }
  inline Fw &operator,(unsigned long long x) {
    if (x) {
      char s[20], c = 0;
      while (x) s[c++] = x % 10 + '0', x /= 10;
      while (c--) P(s[c]);
    } else
      P('0');
    return *this;
  }
  inline Fw &operator()(unsigned long long x) {
    if (x) {
      char s[20], c = 0;
      while (x) s[c++] = x % 10 + '0', x /= 10;
      while (c--) P(s[c]);
    } else
      P('0');
    return *this;
  }
  inline Fw &operator,(char x) {
    P(x);
    return *this;
  }
  inline Fw &operator()(char x) {
    P(x);
    return *this;
  }
  inline Fw &operator,(const char *x) {
    while (*x) P(*x++);
    return *this;
  }
  inline Fw &operator()(const char *x) {
    while (*x) P(*x++);
    return *this;
  }
  inline Fw &operator()(double x, int y) {
    if (y) {
      double t = 0.5;
      for (int i = y; i--;) t *= 0.1;
      if (x >= 0)
        x += t;
      else
        x -= t, P('-');
      *this, (long long)(abs(x));
      P('.');
      if (x < 0) x = -x;
      while (y--) {
        x *= 10;
        x -= floor(x * 0.1) * 10;
        P(((int)x) % 10 + '0');
      }
    } else if (x >= 0)
      *this, (long long)(x + 0.5);
    else
      *this, (long long)(x - 0.5);
    ;
    return *this;
  }
  inline Fw &operator()(long double x, int y) {
    if (y) {
      double t = 0.5;
      for (int i = y; i--;) t *= 0.1;
      if (x >= 0)
        x += t;
      else
        x -= t, P('-');
      *this, (long long)(abs(x));
      P('.');
      if (x < 0) x = -x;
      while (y--) {
        x *= 10;
        x -= floor(x * 0.1) * 10;
        P(((int)x) % 10 + '0');
      }
    } else if (x >= 0)
      *this, (long long)(x + 0.5);
    else
      *this, (long long)(x - 0.5);
    ;
    return *this;
  }
};
Fw<Cp> out;
const int N = 300007;
struct node {
  int ma, po;
} s[1 << 20];
int mi[N];
bool vis[N];
inline void rep(int &x, int y) {
  if (~x)
    repl(x, y);
  else
    x = y;
}
inline void pd(int x) {
  if (~s[x].po)
    rep(s[x << 1].po, s[x].po), rep(s[x << 1 | 1].po, s[x].po), s[x].po = -1;
}
inline void pu1(int x) { s[x].ma = max(s[x << 1].ma, s[x << 1 | 1].ma); }
void gmin(int x, int l, int r, int ql, int qr, int v) {
  if (l >= ql && r <= qr) {
    rep(s[x].po, v);
    return;
  }
  int t = (l + r) >> 1;
  pd(x);
  if (ql <= t) gmin(x << 1, l, t, ql, qr, v);
  if (qr > t) gmin(x << 1 | 1, t + 1, r, ql, qr, v);
}
void gmax(int x, int l, int r, int p, int v) {
  if (l == r) {
    s[x].ma = v;
    if (!~mi[p]) mi[p] = s[x].po;
    vis[p] = 1;
  } else {
    int t = (l + r) >> 1;
    pd(x);
    if (p <= t)
      gmax(x << 1, l, t, p, v);
    else
      gmax(x << 1 | 1, t + 1, r, p, v);
    pu1(x);
  }
}
namespace Qmax {
int ans = 0;
};
void qmax(int x, int l, int r, int ql, int qr) {
  if (l >= ql && r <= qr) {
    repr(Qmax::ans, s[x].ma);
    return;
  }
  int t = (l + r) >> 1;
  if (ql <= t) qmax(x << 1, l, t, ql, qr);
  if (qr > t) qmax(x << 1 | 1, t + 1, r, ql, qr);
}
void calmi(int x, int l, int r) {
  if (l == r) {
    if (!~mi[l]) mi[l] = s[x].po;
  } else {
    int t = (l + r) >> 1;
    pd(x);
    calmi(x << 1, l, t);
    calmi(x << 1 | 1, t + 1, r);
  }
}
inline node operator+(const node &a, const node &b) {
  return a.ma < b.ma ? b : a;
}
inline void pu2(int x) { s[x] = s[x << 1] + s[x << 1 | 1]; }
void build(int x, int l, int r) {
  if (l == r)
    s[x] = (node){mi[l], l};
  else {
    int t = (l + r) >> 1;
    build(x << 1, l, t);
    build(x << 1 | 1, t + 1, r);
    pu2(x);
  }
}
node qrm(int x, int l, int r, int ql, int qr) {
  if (l == ql && r == qr) return s[x];
  int t = (l + r) >> 1;
  if (qr <= t) return qrm(x << 1, l, t, ql, qr);
  if (ql > t) return qrm(x << 1 | 1, t + 1, r, ql, qr);
  return qrm(x << 1, l, t, ql, t) + qrm(x << 1 | 1, t + 1, r, t + 1, qr);
}
void md(int x, int l, int r, int p) {
  if (l == r)
    s[x].ma = 0, !vis[l] ? mi[l] = 0 : 0;
  else {
    int t = (l + r) >> 1;
    if (p <= t)
      md(x << 1, l, t, p);
    else
      md(x << 1 | 1, t + 1, r, p);
    pu2(x);
  }
}
int n, m, res[N];
void calm2(int x, int l, int r) {
  if (l == r) {
    if (!vis[l])
      mi[l] = s[x].ma;
    else if (~res[l])
      mi[l] = 0;
  } else {
    int t = (l + r) >> 1;
    calm2(x << 1, l, t);
    calm2(x << 1 | 1, t + 1, r);
  }
}
struct Qr {
  int l, r, x;
} q[N];
std::pair<int, int> m2[N];
int main() {
  int cnt = 0;
  in, n, m;
  memset(s, 0xff, sizeof(s));
  memset(mi, 0xff, sizeof(mi));
  s[1].po = 1000000000;
  for (int i = 0, iend = m; i < iend; i++) {
    int op, x, y, z;
    in, op, x, y;
    if (op == 1) {
      in, z;
      Qmax::ans = 0;
      qmax(1, 1, n, x, y);
      if (Qmax::ans > z) {
        out, "NO";
        return 0;
      };
      gmin(1, 1, n, x, y, z);
      if (Qmax::ans != z) q[cnt++] = (Qr){x, y, z};
    } else {
      gmax(1, 1, n, x, y);
      q[cnt++] = (Qr){0, x};
    }
  }
  calmi(1, 1, n);
  build(1, 1, n);
  memset(res, 0xff, sizeof(res));
  int ans = 0;
  for (int i = 0, iend = cnt; i < iend; i++) {
    if (!q[i].l) {
      md(1, 1, n, q[i].r);
      continue;
    }
    node t = qrm(1, 1, n, q[i].l, q[i].r);
    if (t.ma < q[i].x) {
      out, "NO";
      return 0;
    };
    md(1, 1, n, t.po);
    ans |= q[i].x;
    res[t.po] = q[i].x;
  }
  calm2(1, 1, n);
  for (int i = 1, iend = n; i <= iend; i++)
    if (!~res[i]) res[i] = 0;
  for (int i = 1, iend = n; i <= iend; i++) m2[i] = std::make_pair(mi[i], i);
  std::sort(m2 + 1, m2 + n + 1, std::greater<std::pair<int, int> >());
  for (int i = 1, iend = n; i <= iend; i++)
    for (int j = (30) - 1; ~j; j--)
      if (!(ans >> j & 1) && m2[i].first >= (1 << j))
        m2[i].first -= 1 << j, ans |= 1 << j, res[m2[i].second] |= 1 << j;
  out, "YES\n";
  for (int i = 1, iend = n; i <= iend; i++) out, res[i], ' ';
}