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;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
long long int prod(long long int a, long long int b) {
  long long int x, d;
  if (b == 0)
    return 1;
  else {
    d = prod(a, b / 2);
    x = (d * d) % 1000000007;
    if (b % 2 == 0)
      return x;
    else
      return (x * (a % 1000000007)) % 1000000007;
  }
}
long long int seg[400005];
long long int bit[50][100005], arr[100005];
vector<pair<long long int, pair<long long int, long long int> > > query;
void init(int node, int l, int r) {
  if (l > r) return;
  if (l == r) {
    seg[node] = arr[l];
    return;
  }
  long long int mid = (l + r) / 2;
  init(2 * node, l, mid);
  init(2 * node + 1, mid + 1, r);
  seg[node] = seg[2 * node] & seg[2 * node + 1];
}
long long int temp = (1ll << 31) - 1;
long long int find(int node, int left, int right, int l, int r) {
  if (l > r || l > right || left > r) return temp;
  if (l <= left && right <= r) return seg[node];
  long long int mid = (left + right) / 2;
  long long int lval = find(2 * node, left, mid, l, r);
  long long int rval = find(2 * node + 1, mid + 1, right, l, r);
  return lval & rval;
}
int main() {
  long long int n, q, i, j, l, r, x;
  scanf("%lld", &n), scanf("%lld", &q);
  for (i = 0; i < q; i++) {
    scanf("%lld", &l), scanf("%lld", &r), scanf("%lld", &x);
    query.push_back(make_pair(l, make_pair(r, x)));
    for (j = 0; j < 30; j++) {
      if ((1 << j) & x) {
        bit[j][l] += 1;
        bit[j][r + 1] -= 1;
      }
    }
  }
  for (i = 1; i < n + 1; i++) {
    for (j = 0; j < 30; j++) {
      bit[j][i] += bit[j][i - 1];
    }
  }
  for (i = 1; i < n + 1; i++) {
    arr[i] = 0;
    for (j = 0; j < 30; j++) {
      if (bit[j][i] > 0) arr[i] += (1ll << j);
    }
  }
  init(1, 1, n);
  long long int flag = 0;
  for (i = 0; i < q; i++) {
    if (find(1, 1, n, query[i].first, query[i].second.first) !=
        query[i].second.second) {
      flag = 1;
      break;
    }
  }
  if (flag)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (i = 1; i < n + 1; i++) cout << arr[i] << " ";
    cout << endl;
  }
  return 0;
}
