#include <bits/stdc++.h>
using namespace std;
const int MAX = 5010, LIM = 1e9;
struct query {
  int t, l, r, x;
};
int main() {
  int n, m;
  long long v[MAX], d[MAX], vaux[MAX];
  bool ok = true;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    v[i] = LIM;
    d[i] = 0;
  }
  vector<query> vq;
  for (int i = 0; i < m; i++) {
    int t, l, r, x;
    scanf("%d%d%d%d", &t, &l, &r, &x);
    t--;
    l--;
    r--;
    vq.push_back({t, l, r, x});
    if (t) {
      for (int j = l; j <= r; j++) v[j] = min(v[j], x - d[j]);
    } else {
      for (int j = l; j <= r; j++) d[j] += x;
    }
  }
  for (int i = 0; i < n; i++) vaux[i] = v[i];
  for (int i = 0; i < m; i++) {
    if (vq[i].t) {
      bool found = false;
      for (int j = vq[i].l; j <= vq[i].r; j++) found |= vq[i].x == vaux[j];
      if (!found) ok = false;
    } else {
      for (int j = vq[i].l; j <= vq[i].r; j++) vaux[j] += vq[i].x;
    }
  }
  for (int i = 0; i < n; i++) {
    if (v[i] < -LIM) ok = false;
  }
  if (ok) {
    printf("YES\n");
    for (int i = 0; i < n; i++) printf("%I64d ", v[i]);
    printf("\n");
  } else {
    printf("NO\n");
  }
  return 0;
}
