#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5000;
int a[MAXN];
int b[MAXN];
int add[MAXN];
int t[MAXN], l[MAXN], r[MAXN], d[MAXN];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) a[i] = 1e9, add[i] = 0;
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d%d", &t[i], &l[i], &r[i], &d[i]);
    --l[i], --r[i];
    if (t[i] == 1) {
      for (int j = l[i]; j <= r[i]; j++) add[j] += d[i];
    } else {
      for (int j = l[i]; j <= r[i]; j++) a[j] = min(a[j], d[i] - add[j]);
    }
  }
  memcpy(b, a, sizeof(b));
  for (int i = 0; i < m; i++) {
    if (t[i] == 1) {
      for (int j = l[i]; j <= r[i]; j++) a[j] += d[i];
    } else {
      if (*max_element(a + l[i], a + r[i] + 1) != d[i]) {
        printf("NO\n");
        return 0;
      }
    }
  }
  printf("YES\n");
  for (int i = 0; i < n; i++) printf("%d%c", b[i], " \n"[i == n - 1]);
  return 0;
}
