We'll call an array of n non-negative integers a[1], a[2], ..., a[n] interesting, if it meets m constraints. The i-th of the m constraints consists of three integers li, ri, qi (1 ≤ li ≤ ri ≤ n) meaning that value <image> should be equal to qi. 

Your task is to find any interesting array of n elements or state that such array doesn't exist.

Expression x&y means the bitwise AND of numbers x and y. In programming languages C++, Java and Python this operation is represented as "&", in Pascal — as "and".

Input

The first line contains two integers n, m (1 ≤ n ≤ 105, 1 ≤ m ≤ 105) — the number of elements in the array and the number of limits.

Each of the next m lines contains three integers li, ri, qi (1 ≤ li ≤ ri ≤ n, 0 ≤ qi < 230) describing the i-th limit.

Output

If the interesting array exists, in the first line print "YES" (without the quotes) and in the second line print n integers a[1], a[2], ..., a[n] (0 ≤ a[i] < 230) decribing the interesting array. If there are multiple answers, print any of them.

If the interesting array doesn't exist, print "NO" (without the quotes) in the single line.

Examples

Input

3 1
1 3 3


Output

YES
3 3 3


Input

3 2
1 3 3
1 3 2


Output

NO
#include <bits/stdc++.h>
using namespace std;
const long long oo = 1e9;
const long long LM = 1e5 + 5;
const int MX = (1 << 31) - 1;
int stree[4 * LM], vals[LM];
int LF[LM], RI[LM], Q[LM];
int bsum[LM];
void update(int node, int left, int right) {
  if (left == right) {
    stree[node] = vals[left];
    return;
  }
  int mid = (left + right) / 2;
  update((node * 2 + 1), left, mid);
  update((node * 2 + 2), mid + 1, right);
  stree[node] = stree[(node * 2 + 1)] & stree[(node * 2 + 2)];
}
int query(int node, int left, int right, int lo, int hi) {
  if (hi < left || lo > right) return MX;
  if (lo <= left && hi >= right) return stree[node];
  int mid = (left + right) / 2, ret = MX;
  ret &= query((node * 2 + 1), left, mid, lo, hi);
  ret &= query((node * 2 + 2), mid + 1, right, lo, hi);
  return ret;
}
class cont483 {
 public:
  void solve() {
    int N, M;
    cin >> N >> M;
    for (int i = 0; i < (int)(M); ++i) cin >> LF[i] >> RI[i] >> Q[i];
    for (int bit = 0; bit < (int)(30); ++bit) {
      memset(bsum, 0, sizeof bsum);
      for (int i = 0; i < (int)(M); ++i)
        if (Q[i] & (1 << bit)) bsum[LF[i]] += 1, bsum[RI[i] + 1] -= 1;
      for (int i = (1); i <= (int)(N); ++i) {
        bsum[i] += bsum[i - 1];
        if (bsum[i] > 0) vals[i] |= (1 << bit);
      }
    }
    update(0, 1, N);
    for (int i = 0; i < (int)(M); ++i) {
      if (query(0, 1, N, LF[i], RI[i]) != Q[i]) {
        cout << "NO" << endl;
        return;
      }
    }
    cout << "YES" << endl;
    for (int i = (1); i <= (int)(N); ++i) cout << vals[i] << " ";
    cout << endl;
  }
};
int main() {
  ios::sync_with_stdio(false);
  cont483 obj;
  obj.solve();
}
