#include <bits/stdc++.h>
using namespace std;
void RD(int &x) { scanf("%d", &x); }
void RD(long long &x) { scanf("%I64d", &x); }
void RD(double &x) { scanf("%lf", &x); }
void RD(int &x, int &y) { scanf("%d%d", &x, &y); }
void RD(long long &x, long long &y) { scanf("%I64d%I64d", &x, &y); }
void RD(double &x, double &y) { scanf("%lf%lf", &x, &y); }
void RD(char *s) { scanf("%s", s); }
void RD(char &s) { scanf("%c", &s); }
void RD(string &s) { cin >> s; }
void PR(int x) { printf("%d\n", x); }
void PR(int x, int y) { printf("%d %d\n", x, y); }
void PR(long long x) { printf("%I64d\n", x); }
void PR(char x) { printf("%c\n", x); }
void PR(char *x) { printf("%s\n", x); }
void PR(string x) { cout << x << endl; }
const long long inf = 1;
const long long mod = 1LL;
const long long lim = (1LL << 30);
long long x[100010], y[100010], q[100010];
long long ans[100010];
long long cum[100010][33];
long long tree[100010][33];
int query(int idx, int bit) {
  int sum = 0;
  while (idx > 0) {
    sum += tree[idx][bit];
    idx -= (idx & -idx);
  }
  return sum;
}
void update(int idx, int bit, int val, int n) {
  while (idx <= n) {
    tree[idx][bit] += val;
    idx += (idx & -idx);
  }
}
int main() {
  int n, m;
  while (scanf("%d %d", &n, &m) == 2) {
    memset(tree, 0, sizeof(tree));
    memset(cum, 0, sizeof(cum));
    memset(ans, 0, sizeof(ans));
    int i, j;
    for ((i) = 1; (i) <= (int)(m); (i)++) {
      RD(x[i], y[i]);
      RD(q[i]);
      for ((j) = 0; (j) <= (int)(30); (j)++) {
        if (q[i] & (1LL << j)) {
          cum[x[i]][j]++;
          cum[y[i] + 1][j]--;
        }
      }
    }
    int flag = 1;
    for ((i) = 1; (i) <= (int)(n); (i)++) {
      for ((j) = 0; (j) <= (int)(30); (j)++) {
        cum[i][j] += cum[i - 1][j];
        if (cum[i][j] > 0) ans[i] += (1LL << j), update(i, j, 1, n);
      }
      if (ans[i] >= lim) flag = 0;
    }
    if (flag)
      for ((i) = 1; (i) <= (int)(m); (i)++) {
        long long val = 0;
        for ((j) = 0; (j) <= (int)(30); (j)++) {
          if ((query(y[i], j) - query(x[i] - 1, j)) == (y[i] - x[i] + 1)) {
            val += (1LL << j);
          }
        }
        if (val != q[i]) {
          flag = 0;
          break;
        }
      }
    if (flag) {
      printf("YES\n");
      for ((i) = 1; (i) <= (int)(n); (i)++) printf("%I64d ", ans[i]);
      printf("\n");
    } else
      printf("NO\n");
  }
  return 0;
}
