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>
const int MAXN = 1e5 + 10;
struct node {
  int l, r, v;
} tr[MAXN << 4];
int tag[MAXN << 4];
int a[MAXN];
void pushdown(int u) {
  tr[u << 1].v |= tag[u];
  tr[u << 1 | 1].v |= tag[u];
  tag[u << 1] |= tag[u];
  tag[u << 1 | 1] |= tag[u];
  tag[u] = 0;
}
void build(int l, int r, int u) {
  tr[u] = {l, r};
  if (l == r) {
    tr[u].v = 0;
    return;
  }
  int mid = l + r >> 1;
  build(l, mid, u << 1);
  build(mid + 1, r, u << 1 | 1);
  tr[u].v = tr[u << 1].v & tr[u << 1 | 1].v;
}
int query(int l, int r, int u) {
  pushdown(u);
  if (l <= tr[u].l && tr[u].r <= r) return tr[u].v;
  int mid = tr[u].l + tr[u].r >> 1;
  int ans = (1 << 30) - 1;
  if (l <= mid) ans &= query(l, r, u << 1);
  if (r > mid) ans &= query(l, r, u << 1 | 1);
  return ans;
}
void modify(int l, int r, int x, int u) {
  if (l <= tr[u].l && tr[u].r <= r) {
    tag[u] |= x;
    tr[u].v |= x;
    return;
  }
  pushdown(u);
  int mid = tr[u].l + tr[u].r >> 1;
  if (l <= mid) modify(l, r, x, u << 1);
  if (r > mid) modify(l, r, x, u << 1 | 1);
  tr[u].v = tr[u << 1].v & tr[u << 1 | 1].v;
}
void pushall(int u) {
  if (tr[u].l == tr[u].r) {
    a[tr[u].l] = tr[u].v;
    return;
  }
  pushdown(u);
  pushall(u << 1);
  pushall(u << 1 | 1);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  build(1, n, 1);
  std::vector<std::tuple<int, int, int> > cod;
  while (m--) {
    int l, r, x;
    scanf("%d%d%d", &l, &r, &x);
    cod.push_back(std::make_tuple(l, r, x));
    modify(l, r, x, 1);
  }
  bool f = 0;
  for (auto &i : cod) {
    int l = std::get<0>(i), r = std::get<1>(i), x = std::get<2>(i);
    if (query(l, r, 1) != x) {
      f = 1;
      break;
    }
  }
  if (f)
    printf("NO\n");
  else {
    printf("YES\n");
    pushall(1);
    for (int i = 1; i <= n; ++i) printf("%d ", a[i]);
  }
  return 0;
}
