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 ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
ll gcd(ll a, ll b) {
  ll t;
  while ((t = a % b) != 0) {
    a = b;
    b = t;
  }
  return b;
}
ll fast_exp(ll base, ll n, ll m) {
  if (n == 0) return 1;
  ll t = fast_exp(base, n / 2, m);
  if (n % 2 == 0)
    return (t * t) % m;
  else
    return (((t * t) % m) * base) % m;
}
ll binary_search_ub(vector<ll> vec, ll val) {
  ll low = 0, high = vec.size() - 1;
  if (vec[high] < val) return -1;
  while (low < high) {
    ll mid = low + (high - low) / 2;
    if (vec[mid] >= val)
      high = mid;
    else
      low = mid + 1;
  }
  return high;
}
ll binary_search_lb(vector<ll> vec, ll val) {
  ll low = 0, high = vec.size() - 1;
  if (vec[low] > val) return -1;
  while (low < high) {
    ll mid = low + (high - low + 1) / 2;
    if (vec[mid] <= val)
      low = mid;
    else
      high = mid - 1;
  }
  return low;
}
int n, m;
int tab[100001][30], dp[100001][30];
int cnt[30];
bool foo(pair<pii, ll> a, pair<pii, ll> b) {
  return a.first.first < b.first.first;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  vector<pair<pii, ll>> q;
  for (int i = 0; i < m; i++) {
    int l, r;
    ll v;
    cin >> l >> r >> v;
    q.push_back(make_pair(make_pair(l, r), v));
  }
  sort(q.begin(), q.end(), foo);
  int curr = 0, i = 1;
  while (curr < m) {
    while (i < q[curr].first.first) {
      for (int b = 0; b < 30; b++)
        if (cnt[b]) {
          dp[i][b] = 1;
          cnt[b]--;
        }
      i++;
    }
    ll val = q[curr].second;
    int l = q[curr].first.first, r = q[curr].first.second;
    for (int bit = 0; bit < 30; bit++)
      if ((val >> bit) & 1) cnt[bit] = max(cnt[bit], r - l + 1);
    curr++;
  }
  while (i <= n) {
    for (int b = 0; b < 30; b++)
      if (cnt[b]) {
        dp[i][b] = 1;
        cnt[b]--;
      }
    i++;
  }
  for (int i = 1; i <= n; i++)
    for (int b = 0; b < 30; b++) tab[i][b] = tab[i - 1][b] + dp[i][b];
  bool flag = true;
  for (auto p : q) {
    ll val = p.second;
    int l = p.first.first, r = p.first.second;
    bool bits[30];
    memset(bits, false, sizeof bits);
    for (int b = 0; b < 30; b++)
      if (!((val >> b) & 1)) {
        if (tab[r][b] - tab[l - 1][b] == (r - l + 1)) flag = false;
      }
    if (!flag) break;
  }
  if (!flag)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (int i = 1; i <= n; i++) {
      ll ans = 0;
      for (int b = 0; b < 30; b++)
        if (dp[i][b]) ans += 1 << b;
      cout << ans << " ";
    }
    cout << "\n";
  }
  return 0;
}
