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, m, l, r, q;
map<pair<int, int>, int> vi;
int V[100005 << 2], ly[100005 << 2];
void push_down(int o) {
  if (ly[o]) {
    ly[o << 1] |= ly[o];
    ly[o << 1 | 1] |= ly[o];
    V[o << 1] |= ly[o];
    V[o << 1 | 1] |= ly[o];
    ly[o] = 0;
  }
}
void push_up(int o) { V[o] = V[o << 1] & V[o << 1 | 1]; }
void ud(int o, int l, int r, int L, int R, int x) {
  int mid = (l + r) / 2;
  if (L <= l && r <= R) {
    V[o] |= x;
    ly[o] |= x;
    return;
  }
  push_down(o);
  if (L <= mid) ud(o << 1, l, mid, L, R, x);
  if (R > mid) ud(o << 1 | 1, mid + 1, r, L, R, x);
  push_up(o);
}
int qy(int o, int l, int r, int L, int R) {
  int mid = (l + r) / 2;
  if (L <= l && r <= R) return V[o];
  push_down(o);
  int ans = (1 << 30) - 1;
  if (L <= mid) ans &= qy(o << 1, l, mid, L, R);
  if (R > mid) ans &= qy(o << 1 | 1, mid + 1, r, L, R);
  push_up(o);
  return ans;
}
int main() {
  cin >> n >> m;
  int ok = 1;
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d", &l, &r, &q);
    int tp = qy(1, 1, n, l, r);
    if (vi[make_pair(l, r)]) {
      if (tp != q) {
        ok = 0;
      }
    }
    if (!ok) continue;
    vi[make_pair(l, r)] = 1;
    if ((tp & q) == tp)
      ud(1, 1, n, l, r, q);
    else
      ok = 0;
  }
  if (!ok) {
    puts("NO");
    return 0;
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++) printf("%d ", qy(1, 1, n, i, i));
}
