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;
using ULL = unsigned long long;
using UL = unsigned;
using LL = long long;
struct RAQ {
  vector<UL> node;
  UL N;
  UL n;
  void init(UL n) {
    N = 1;
    while (N < n) N <<= 1;
    this->n = n;
    node.assign(N * 2 - 1, 0);
  }
  UL query(UL a, UL b, UL l = 0, UL r = -1, UL i = 0) {
    if (r == -1) r = N;
    if (b <= l || r <= a) return -1;
    if (a <= l && r <= b) return node[i];
    return (query(a, b, l, (l + r) / 2, i * 2 + 1) &
            query(a, b, (l + r) / 2, r, i * 2 + 2)) |
           node[i];
  }
  void update(UL a, UL b, UL v, UL l = 0, UL r = -1, UL i = 0) {
    if (r == -1) r = N;
    if (b <= l || r <= a) return;
    if (a <= l && r <= b) {
      node[i] |= v;
      return;
    }
    update(a, b, v | node[i], l, (l + r) / 2, i * 2 + 1);
    update(a, b, v | node[i], (l + r) / 2, r, i * 2 + 2);
    node[i] |= node[i * 2 + 1] & node[i * 2 + 2];
  }
};
struct Problem {
  void Solve() {
    UL N, M;
    cin >> N >> M;
    RAQ Q;
    Q.init(N);
    vector<pair<pair<UL, UL>, UL>> C(M);
    for (UL i = 0; i < (M); i++) {
      UL l, r, a;
      cin >> l >> r >> a;
      l--;
      C[i] = {{l, r}, a};
      Q.update(l, r, a);
    }
    bool ok = true;
    for (UL i = 0; i < (M); i++) {
      UL buf = Q.query(C[i].first.first, C[i].first.second);
      if (buf != C[i].second) ok = false;
    }
    if (!ok) {
      cout << "NO" << endl;
      return;
    }
    cout << "YES" << endl;
    for (UL i = 0; i < (N); i++) {
      if (i) cout << " ";
      cout << Q.query(i, i + 1);
    }
    cout << endl;
  }
  Problem();
};
int main() {
  unique_ptr<Problem> p(new Problem());
  p->Solve();
  return 0;
}
Problem::Problem() { cout << fixed << setprecision(10); }
