#include <bits/stdc++.h>
using namespace std;
const int maxn = 5123;
const int LIM = 1e9;
int n, m;
int a[maxn], inc[maxn], op[maxn], l[maxn], r[maxn], d[maxn];
int main() {
  scanf("%d%d", &n, &m);
  fill(a + 1, a + n + 1, LIM);
  for (int(i) = (1); (i) <= (m); (i)++) {
    scanf("%d%d%d%d", op + i, l + i, r + i, d + i);
    if (op[i] == 1)
      for (int(j) = (l[i]); (j) <= (r[i]); (j)++) inc[j] += d[i];
    else
      for (int(j) = (l[i]); (j) <= (r[i]); (j)++)
        a[j] = min(a[j], d[i] - inc[j]);
  }
  memcpy(inc + 1, a + 1, n * sizeof(int));
  bool ok = true;
  for (int(i) = (1); (i) <= (m); (i)++) {
    if (op[i] == 1)
      for (int(j) = (l[i]); (j) <= (r[i]); (j)++) inc[j] += d[i];
    else {
      int mx = -1e9;
      for (int(j) = (l[i]); (j) <= (r[i]); (j)++) mx = max(mx, inc[j]);
      if (mx != d[i]) {
        ok = false;
        break;
      }
    }
  }
  if (ok) {
    puts("YES");
    for (int(i) = (1); (i) <= (n); (i)++) printf("%d ", a[i]);
  } else
    puts("NO");
}
