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 long long INF = 1e18;
long long pow(long long a, long long b) {
  return (!b ? 1 : pow(a, b / 2) * pow(a, b / 2) * (b % 2 == 1 ? a : 1));
}
const long long MAXN = 1e5 + 100, LG = 30;
long long n, m, a[MAXN], ok[MAXN][LG + 2], s[MAXN << 2], T = (1 << 30) - 1;
vector<pair<pair<long long, long long>, long long> > query;
void fail() {
  cout << "NO";
  exit(0);
}
void build(long long id = 1, long long l = 0, long long r = n) {
  if (r - l < 2) {
    s[id] = a[l];
    return;
  }
  long long mid = (l + r) >> 1;
  build(id * 2, l, mid);
  build(id * 2 + 1, mid, r);
  s[id] = s[id * 2] & s[id * 2 + 1];
}
long long find(long long x, long long y, long long id = 1, long long l = 0,
               long long r = n) {
  if (x >= r || y <= l) return T;
  if (x <= l && y >= r) return s[id];
  long long mid = (l + r) >> 1;
  return find(x, y, id * 2, l, mid) & find(x, y, id * 2 + 1, mid, r);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  while (m--) {
    long long l, r, q;
    cin >> l >> r >> q;
    l--, r--;
    query.push_back({{l, r}, q});
    long long now = (1 << 30), i = 30;
    while (now > 0) {
      if (q >= now) {
        q -= now;
        if (l)
          ok[r][i]++, ok[l - 1][i]--;
        else
          ok[r][i]++;
      }
      i--, now /= 2;
    }
  }
  for (long long i = n - 1; i >= 0; i--) {
    for (long long j = 0; j <= 30; j++) {
      ok[i][j] += ok[i + 1][j];
      if (ok[i][j]) a[i] += (1 << j);
    }
  }
  build();
  for (auto t : query) {
    long long l = t.first.first, r = t.first.second, q = t.second;
    r++;
    if (find(l, r) != q) fail();
  }
  cout << "YES\n";
  for (long long i = 0; i < n; i++) cout << a[i] << " ";
}
