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 n;
long long B = (1 << 30) - 1;
long long a[100001], q[100001];
int sum[100001], le[100001], ri[100001];
struct Tree {
  Tree *pl, *pr;
  int l, r;
  long long And;
  void update() { And = (pl->And) & (pr->And); }
  Tree(int l, int r) : l(l), r(r) {
    if (l + 1 == r) {
      And = a[l];
      return;
    }
    pl = new Tree(l, (l + r) >> 1);
    pr = new Tree((l + r) >> 1, r);
    update();
  }
  long long getAND(int L, int R) {
    if (L <= l && r <= R) {
      return And;
    }
    if (L >= r || R <= l) {
      return B;
    }
    return (pl->getAND(L, R)) & (pr->getAND(L, R));
  }
} * rt;
int main() {
  int m;
  cin >> n >> m;
  memset(a, 0, sizeof(a));
  for (int i = 0; i < m; i++) {
    cin >> le[i] >> ri[i] >> q[i];
  }
  for (int bit = 0; bit <= 30; bit++) {
    memset(sum, 0, sizeof(sum));
    for (int i = 0; i < m; i++) {
      if ((q[i] >> bit) & 1) {
        sum[le[i] - 1]++;
        sum[ri[i]]--;
      }
    }
    for (int i = 0; i < n; i++) {
      if (i) sum[i] += sum[i - 1];
      if (sum[i] > 0) a[i] |= (1 << bit);
    }
  }
  rt = new Tree(0, n);
  for (int i = 0; i < m; i++) {
    if (rt->getAND(le[i] - 1, ri[i]) != q[i]) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  return 0;
}
