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 int N = 100010;
const int MAXN = 30;
int t[4 * N];
int a[N], l[N], r[N], q[N], b[N] = {0};
void get_tree(int nd, int s, int e) {
  if (s == e) {
    t[nd] = b[s];
    return;
  } else {
    int md = (s + e) >> 1;
    get_tree(2 * nd, s, md);
    get_tree(2 * nd + 1, md + 1, e);
    t[nd] = t[2 * nd] & t[2 * nd + 1];
    return;
  }
}
int qry(int nd, int s, int e, int le, int re) {
  if (s > e || e < le || s > re)
    return (1 << MAXN) - 1;
  else if (le <= s && e <= re)
    return t[nd];
  else {
    int md = (s + e) >> 1;
    return qry(2 * nd, s, md, le, re) & qry(2 * nd + 1, md + 1, e, le, re);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, ans = 0, m, x, y, sum = 0;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> l[i] >> r[i] >> q[i];
  }
  for (int j = 30; j >= 0; j--) {
    for (int i = 1; i <= n; i++) a[i] = 0;
    for (int i = 0; i < m; i++) {
      if ((1 << j) & q[i]) {
        a[l[i]]++;
        if (r[i] + 1 <= n) a[r[i] + 1]--;
      }
    }
    for (int i = 1; i <= n; i++) {
      a[i] += a[i - 1];
      if (a[i] > 0) b[i] |= (1 << j);
    }
  }
  get_tree(1, 1, n);
  for (int i = 0; i < m; i++) {
    ans = qry(1, 1, n, l[i], r[i]);
    if (ans == q[i])
      continue;
    else {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) {
    cout << b[i] << " ";
  }
  cout << endl;
}
