#include <bits/stdc++.h>
using namespace std;
int a[11000];
int ans[11000];
int M[11000];
int kind[11000], ll[11000], rr[11000], d[11000];
int main() {
  int n, m, i, j, k;
  cin >> n >> m;
  for (i = 1; i <= n; i++) M[i] = 1000000000;
  int l, r, t;
  for (i = 1; i <= m; i++) {
    scanf("%d", &j);
    if (j == 1) {
      scanf("%d%d%d", &l, &r, &t);
      for (k = l; k <= r; k++) a[k] += t;
    } else {
      scanf("%d%d%d", &l, &r, &t);
      for (k = l; k <= r; k++) M[k] = min(M[k], t - a[k]);
    }
    kind[i] = j, ll[i] = l, rr[i] = r, d[i] = t;
  }
  for (i = 1; i <= n; i++) ans[i] = a[i] = M[i];
  for (i = 1; i <= m; i++) {
    if (kind[i] == 1) {
      for (k = ll[i]; k <= rr[i]; k++) a[k] += d[i];
    } else {
      int mm = -2100000000;
      for (k = ll[i]; k <= rr[i]; k++) mm = max(mm, a[k]);
      if (mm != d[i]) {
        puts("NO");
        return 0;
      }
    }
  }
  puts("YES");
  for (i = 1; i <= n; i++) printf("%d ", ans[i]);
  puts("");
}
