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;
long long sum[100005][34], l[100000], r[100000], a[100000], t[1000000],
    q[1000000];
void build(long long idx, long long l, long long r) {
  if (l == r) {
    t[idx] = a[l];
    return;
  }
  long long mid = (l + r) >> 1;
  build(idx * 2, l, mid);
  build(idx * 2 + 1, mid + 1, r);
  t[idx] = t[idx * 2] & t[idx * 2 + 1];
}
long long query(long long idx, long long l, long long r, long long i,
                long long j) {
  if (r < i || l > j) return ((1 << 31) - 1);
  if (l == i && r == j) return t[idx];
  long long mid = (l + r) >> 1;
  return (query(idx * 2, l, mid, i, min(mid, j)) &
          query(idx * 2 + 1, mid + 1, r, max(mid + 1, i), j));
}
int main() {
  long long n, m, i, bit;
  scanf("%lld %lld", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%lld %lld %lld", &l[i], &r[i], &q[i]);
  }
  for (bit = 0; bit <= 32; bit++) {
    for (i = 1; i <= m; i++) {
      if ((q[i] >> bit) & 1) {
        sum[l[i]][bit]++;
        sum[r[i] + 1][bit]--;
      }
    }
    long long k = 0;
    for (i = 1; i <= n; i++) {
      k += sum[i][bit];
      if (k) a[i] |= 1 << bit;
    }
  }
  build(1, 1, n);
  for (i = 1; i <= m; i++) {
    if (query(1, 1, n, l[i], r[i]) != q[i]) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  for (i = 1; i <= n; i++) printf("%lld ", a[i]);
  return 0;
}
