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 = 1e5 + 7;
map<pair<int, int>, int> mp;
struct Seg {
  int tree[N * 4], lazy[N * 4];
  inline void pushup(int p) { tree[p] = (tree[p << 1] & tree[p << 1 | 1]); }
  inline void pushdown(int p) {
    if (lazy[p]) {
      tree[p << 1] |= lazy[p];
      tree[p << 1 | 1] |= lazy[p];
      lazy[p << 1] |= lazy[p];
      lazy[p << 1 | 1] |= lazy[p];
      lazy[p] = 0;
    }
  }
  void update(int p, int l, int r, int x, int y, int val) {
    if (x <= l && y >= r) {
      tree[p] |= val;
      lazy[p] |= val;
      return;
    }
    int mid = l + r >> 1;
    pushdown(p);
    if (x <= mid) update(p << 1, l, mid, x, y, val);
    if (y > mid) update(p << 1 | 1, mid + 1, r, x, y, val);
    pushup(p);
  }
  int query(int p, int l, int r, int x, int y) {
    if (x <= l && y >= r) return tree[p];
    int mid = l + r >> 1;
    pushdown(p);
    int ans = (1 << 30) - 1;
    if (x <= mid) ans &= query(p << 1, l, mid, x, y);
    if (y > mid) ans &= query(p << 1 | 1, mid + 1, r, x, y);
    return ans;
  }
  void print(int p, int l, int r) {
    if (l == r) {
      printf("%d ", tree[p]);
      return;
    }
    int mid = l + r >> 1;
    pushdown(p);
    print(p << 1, l, mid);
    print(p << 1 | 1, mid + 1, r);
  }
} seg;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  bool res = true;
  while (m--) {
    int l, r, q;
    scanf("%d%d%d", &l, &r, &q);
    if (mp.count(pair<int, int>(l, r)) && mp[pair<int, int>(l, r)] != q) {
      res = false;
    }
    mp[pair<int, int>(l, r)] = q;
    if (!res) continue;
    int temp = seg.query(1, 1, n, l, r);
    if ((temp & q) != temp) {
      res = false;
    } else {
      seg.update(1, 1, n, l, r, q - temp);
    }
  }
  if (res == 0) {
    puts("NO");
  } else {
    puts("YES");
    seg.print(1, 1, n);
  }
  return 0;
}
