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;
const int N = 100010, MP = 30;
int val[MP + 2][N], n, m, ans[N];
struct data {
  int l, r;
};
vector<data> dat[MP];
bool solve(int sgn) {
  int x, y;
  for (int i = 1; i <= n; ++i) val[sgn][i] += val[sgn][i - 1];
  for (int i = 1; i <= n; ++i) val[sgn][i] = (val[sgn][i] ? 1 : 0);
  for (int i = 1; i <= n; ++i) val[sgn][i] += val[sgn][i - 1];
  for (int i = 0; i < (int)dat[sgn].size(); ++i) {
    x = dat[sgn][i].l, y = dat[sgn][i].r;
    if (val[sgn][y] - val[sgn][x - 1] == y - x + 1) return 0;
  }
  return 1;
}
int main() {
  int a, b, c, t;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d%d", &a, &b, &c);
    for (int j = 0; j <= MP; ++j) {
      t = (c & (1 << j));
      if (t) {
        ++val[j][a];
        --val[j][b + 1];
      } else {
        dat[j].push_back((data){a, b});
      }
    }
  }
  for (int i = 0; i <= MP; ++i)
    if (!solve(i)) return 0 * printf("NO\n");
  puts("YES");
  for (int j = 0; j <= MP; ++j)
    for (int i = 1; i <= n; ++i) {
      ans[i] += (1 << j) * (val[j][i] - val[j][i - 1]);
    }
  for (int i = 1; i <= n; ++i) printf("%d ", ans[i]);
  return 0;
}
