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;
pair<int, int> p[2][33][100010];
int a[100010], cnt[2][33];
int vst[33];
void dig(int n) {
  for (int i = 0; i < 30; i++) {
    vst[i] = n & 1;
    n >>= 1;
  }
}
int main() {
  int N, M, i, j, L, R, q;
  scanf("%d %d", &N, &M);
  for (i = 0; i < M; i++) {
    scanf("%d %d %d", &L, &R, &q);
    dig(q);
    for (j = 0; j < 30; j++) {
      p[vst[j]][j][cnt[vst[j]][j]++] = pair<int, int>(L, R);
    }
  }
  for (i = 0; i < 30; i++) {
    sort(p[1][i], p[1][i] + cnt[1][i]);
    int ct = 0;
    for (j = 1; j < cnt[1][i]; j++) {
      if (p[1][i][ct].second + 1 >= p[1][i][j].first) {
        p[1][i][ct].second = max(p[1][i][ct].second, p[1][i][j].second);
      } else {
        p[1][i][++ct] = p[1][i][j];
      }
    }
    cnt[1][i] = min(cnt[1][i], ct + 1);
  }
  for (i = 0; i < 30; i++) {
    if (cnt[1][i] == 0) continue;
    for (j = 0; j < cnt[0][i]; j++) {
      int s = upper_bound(p[1][i], p[1][i] + cnt[1][i],
                          pair<int, int>(p[0][i][j].first, 100010)) -
              p[1][i];
      s--;
      if (s < 0) continue;
      if (p[1][i][s].second >= p[0][i][j].second) {
        puts("NO");
        return 0;
      }
    }
  }
  puts("YES");
  for (i = 0; i < 30; i++) {
    int t = (1 << i);
    for (j = 0; j < cnt[1][i]; j++) {
      for (int k = p[1][i][j].first; k <= p[1][i][j].second; k++) a[k] += t;
    }
  }
  for (i = 1; i <= N; i++) {
    printf("%d ", a[i]);
  }
  puts("");
  return 0;
}
