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;
int l[100005], r[100005];
long long q[100005];
vector<int> ope[40];
int pre[100005][40];
int on[100005][40];
int sum[100005][40];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= int(m); i++) {
    cin >> l[i] >> r[i] >> q[i];
    for (int j = 0; j < int(33); j++) {
      if (q[i] & (1ll << j)) ope[j].push_back(i);
    }
  }
  for (int k = 0; k < int(33); k++) {
    for (auto ind : ope[k]) {
      int li = l[ind], ri = r[ind];
      pre[li][k]++;
      pre[ri + 1][k]--;
    }
    for (int i = 1; i <= int(n); i++) {
      pre[i][k] += pre[i - 1][k];
      if (pre[i][k] > 0) {
        on[i][k] = 1;
        sum[i][k] = 1;
      }
    }
    for (int i = 1; i <= int(n); i++) sum[i][k] += sum[i - 1][k];
  }
  bool work = true;
  for (int i = 1; i <= int(m); i++) {
    for (int k = 0; k < int(33); k++) {
      if (!(q[i] & (1ll << k))) {
        long long suma = sum[r[i]][k] - sum[l[i] - 1][k];
        if (suma >= r[i] - l[i] + 1) work = false;
      }
    }
  }
  if (!work) {
    cout << "NO" << '\n';
    return 0;
  }
  cout << "YES" << '\n';
  for (int i = 1; i <= int(n); i++) {
    long long val = 0;
    for (int k = 0; k < int(33); k++)
      if (on[i][k]) val |= (1ll << k);
    cout << val << ' ';
  }
  return 0;
}
