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;
long long mx;
struct q {
  long long l, r, v;
};
q q[200005];
long long sum[32][200005], arr[200005], tree[800005];
void build(long long lo, long long hi, long long id) {
  if (lo > hi) return;
  if (lo == hi) {
    tree[id] = arr[lo];
    return;
  }
  long long mid = (lo + hi) / 2;
  build(lo, mid, 2 * id);
  build(mid + 1, hi, 2 * id + 1);
  tree[id] = tree[2 * id] & tree[2 * id + 1];
  return;
}
long long query(long long lo, long long hi, long long l, long long r,
                long long id) {
  if (lo > hi || lo > r || hi < l) return mx;
  if (lo >= l && hi <= r) return tree[id];
  long long mid = (lo + hi) / 2;
  long long t1 = query(lo, mid, l, r, 2 * id);
  long long t2 = query(mid + 1, hi, l, r, 2 * id + 1);
  return (t1 & t2);
}
int main() {
  mx = 1ll << 32;
  mx--;
  long long n, m;
  cin >> n >> m;
  for (long long i = 1; i <= m; ++i) {
    cin >> q[i].l >> q[i].r >> q[i].v;
    for (long long bit = 0; bit <= 31; ++bit) {
      if ((1ll << bit) & q[i].v) {
        sum[bit][q[i].l]++;
        sum[bit][q[i].r + 1]--;
      }
    }
  }
  for (long long bit = 0; bit <= 31; ++bit) {
    for (long long i = 1; i <= n; ++i) {
      sum[bit][i] += sum[bit][i - 1];
      if (sum[bit][i] > 0) arr[i] |= (1ll << bit);
    }
  }
  build(1, n, 1);
  for (long long i = 1; i <= m; ++i) {
    if (query(1, n, q[i].l, q[i].r, 1) != q[i].v) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES" << endl;
  for (long long i = 1; i <= n; ++i) cout << arr[i] << " ";
  cout << endl;
  return 0;
}
