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;
template <class T>
void debug(T a, T b) {
  ;
}
long long a, b;
using namespace std;
long long tree[300001], lazy[300001];
void update_tree(int node, int a, int b, int i, int j, int value) {
  if (lazy[node] != 0) {
    tree[node] |= lazy[node];
    if (a != b) {
      lazy[node * 2] |= lazy[node];
      lazy[node * 2 + 1] |= lazy[node];
    }
    lazy[node] = 0;
  }
  if (a > b || a > j || b < i) return;
  if (a >= i && b <= j) {
    tree[node] |= value;
    if (a != b) {
      lazy[node * 2] |= value;
      lazy[node * 2 + 1] |= value;
    }
    return;
  }
  update_tree(node * 2, a, (a + b) / 2, i, j, value);
  update_tree(1 + node * 2, 1 + (a + b) / 2, b, i, j, value);
  tree[node] = tree[node * 2] & tree[node * 2 + 1];
}
int query_tree(int node, int a, int b, int i, int j) {
  if (a > b || a > j || b < i) return -1;
  if (lazy[node] != 0) {
    tree[node] |= lazy[node];
    if (a != b) {
      lazy[node * 2] |= lazy[node];
      lazy[node * 2 + 1] |= lazy[node];
    }
    lazy[node] = 0;
  }
  if (a >= i && b <= j) return tree[node];
  int q1 = query_tree(node * 2, a, (a + b) / 2, i, j);
  int q2 = query_tree(1 + node * 2, 1 + (a + b) / 2, b, i, j);
  int res = q1 & q2;
  return res;
}
long long l[100010], r[100010], q[100010];
long long n, m;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    cin >> l[i] >> r[i] >> q[i];
    update_tree(1, 0, n - 1, --l[i], --r[i], q[i]);
  }
  for (long long i = 0; i < m; i++) {
    cin >> l[i] >> r[i] >> q[i];
    if (query_tree(1, 0, n - 1, l[i], r[i]) != q[i]) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES" << endl;
  for (long long i = 0; i < n; i++) {
    cout << query_tree(1, 0, n - 1, i, i) << " ";
  }
}
