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 comment(linker, "/STACK:100000000,100000000")
long long max(long long x, long long y) { return x > y ? x : y; }
long long min(long long x, long long y) { return x < y ? x : y; }
using namespace std;
const long long N = 1e5 + 9;
long long n, a, b, k;
long long sum[4 * N], laz[4 * N];
long long res[N];
long long ql[N], qr[N], qv[N];
void upd(long long nd, long long val, long long l, long long r, long long L,
         long long R) {
  long long mid = (L + R) / 2;
  if (l == L && r == R) {
    laz[nd] |= val;
    sum[nd] |= val;
    return;
  }
  if (r <= mid)
    upd(nd * 2 + 1, val, l, r, L, mid);
  else if (l >= mid + 1)
    upd(nd * 2 + 2, val, l, r, mid + 1, R);
  else {
    upd(nd * 2 + 1, val, l, mid, L, mid);
    upd(nd * 2 + 2, val, mid + 1, r, mid + 1, R);
  }
  sum[nd] = sum[nd * 2 + 1] & sum[nd * 2 + 2];
}
long long get(long long nd, long long l, long long r, long long L,
              long long R) {
  long long mid = (L + R) / 2;
  long long res = sum[nd] | laz[nd];
  if (L == l && r == R) return res;
  if (r <= mid) {
    res = get(nd * 2 + 1, l, r, L, mid) | laz[nd];
    return res;
  }
  if (l >= mid + 1) {
    res = get(nd * 2 + 2, l, r, mid + 1, R) | laz[nd];
    return res;
  }
  res = (get(nd * 2 + 1, l, mid, L, mid) &
         get(nd * 2 + 2, mid + 1, r, mid + 1, R)) |
        laz[nd];
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, m;
  long long nm = 1;
  cin >> n >> m;
  while (nm < n) nm *= 2;
  for (long long i = 0; i < m; i++) {
    cin >> ql[i] >> qr[i] >> qv[i];
    ql[i]--;
    qr[i]--;
    upd(0, qv[i], ql[i], qr[i], 0, nm - 1);
  }
  for (long long i = 0; i < m; i++)
    if (get(0, ql[i], qr[i], 0, nm - 1) != qv[i]) {
      cout << "NO";
      return 0;
    }
  cout << "YES\n";
  for (long long i = 0; i < n; i++) cout << get(0, i, i, 0, nm - 1) << ' ';
  cout << endl;
}
