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>
#pragma warning(disable : 4996)
using namespace std;
int num[100090 << 2];
int num2[100090 << 2];
int m, n, tot;
void Update(int L, int R, int c, int l, int r, int rt) {
  if (L <= l && R >= r) {
    num[rt] = (num[rt] | c);
    return;
  }
  int m = (l + r) >> 1;
  if (L <= m) Update(L, R, c, l, m, rt << 1);
  if (R > m) Update(L, R, c, m + 1, r, rt << 1 | 1);
}
int Query2(int L, int R, int l, int r, int rt) {
  if (L <= l && r <= R) {
    return num2[rt];
  }
  int m = (l + r) >> 1;
  int ret = 0x7fffffff;
  if (L <= m) ret = (ret & Query2(L, R, l, m, rt << 1));
  if (R > m) ret = (ret & Query2(L, R, m + 1, r, rt << 1 | 1));
  return ret;
}
void BuildTree(int l, int r, int rt) {
  num[rt] = 0;
  if (l == r) return;
  int m = (l + r) >> 1;
  BuildTree(l, m, rt << 1);
  BuildTree(m + 1, r, rt << 1 | 1);
}
int Check(int n) {
  if (n == 1)
    return num[n];
  else {
    return (num[n] | Check(n / 2));
  }
}
int BuildTree2(int l, int r, int rt) {
  if (l == r) return num2[rt];
  int m = (l + r) >> 1;
  int m1 = BuildTree2(l, m, rt << 1);
  int m2 = BuildTree2(m + 1, r, rt << 1 | 1);
  num2[rt] = (m1 & m2);
  return num2[rt];
}
struct query {
  int l, r, q;
} Q[100090];
int main() {
  int l, r, q;
  while (~scanf("%d%d", &n, &m)) {
    int s = n;
    int t = 1;
    while (t < n) t <<= 1;
    n = t;
    BuildTree(1, n, 1);
    for (int i = 0; i < m; i++) {
      scanf("%d%d%d", &Q[i].l, &Q[i].r, &Q[i].q);
      Update(Q[i].l, Q[i].r, Q[i].q, 1, n, 1);
    }
    for (int i = n; i < n + s; i++) {
      num2[i] = Check(i);
    }
    for (int i = n + s; i < 2 * n; i++) {
      num2[i] = 0x7fffffff;
    }
    BuildTree2(1, n, 1);
    bool flag = false;
    for (int i = 0; i < m; i++) {
      if (Query2(Q[i].l, Q[i].r, 1, n, 1) != Q[i].q) {
        flag = true;
        break;
      }
    }
    if (!flag) {
      printf("YES\n");
      for (int i = n; i < n + s; i++) {
        printf("%d", num2[i]);
        if (i == n + s - 1)
          printf("\n");
        else
          printf(" ");
      }
    } else
      printf("NO\n");
  }
  return 0;
}
