#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 5000;
const int MAX_M = 5000;
const int INF = 1 << 30;
int ts[MAX_M], ls[MAX_M], rs[MAX_M], ds[MAX_M];
int as[MAX_N], bs[MAX_N];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++)
    scanf("%d%d%d%d", ts + i, ls + i, rs + i, ds + i), ls[i]--;
  fill(as, as + n, INF);
  for (int i = m - 1; i >= 0; i--) {
    if (ts[i] == 1) {
      for (int j = ls[i]; j < rs[i]; j++)
        if (as[j] < INF) as[j] -= ds[i];
    } else {
      bool ok = false;
      for (int j = ls[i]; j < rs[i]; j++)
        if (as[j] >= ds[i]) {
          as[j] = ds[i];
          ok = true;
        }
      if (!ok) {
        puts("NO");
        return 0;
      }
    }
  }
  for (int j = 0; j < n; j++)
    if (as[j] >= INF) as[j] = 0;
  copy(as, as + n, bs);
  for (int i = 0; i < m; i++) {
    if (ts[i] == 1) {
      for (int j = ls[i]; j < rs[i]; j++) bs[j] += ds[i];
    } else {
      int maxa = -INF;
      for (int j = ls[i]; j < rs[i]; j++)
        if (maxa < bs[j]) maxa = bs[j];
      if (maxa != ds[i]) {
        puts("NO");
        return 0;
      }
    }
  }
  puts("YES");
  for (int j = 0; j < n; j++) {
    if (j) putchar(' ');
    printf("%d", as[j]);
  }
  putchar('\n');
  return 0;
}
