#include <bits/stdc++.h>
using namespace std;
const int maxn = 5005;
const int INF = (int)1e9;
int n, m, a[maxn], b[maxn], t[maxn], x[maxn], y[maxn], z[maxn];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) a[i] = INF;
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d%d", &t[i], &x[i], &y[i], &z[i]);
    if (t[i] == 1) {
      for (int j = x[i]; j <= y[i]; j++) b[j] += z[i];
    } else {
      for (int j = x[i]; j <= y[i]; j++) {
        a[j] = min(a[j], z[i] - b[j]);
      }
    }
  }
  memset(b, 0, sizeof(b));
  for (int i = 0; i < m; i++) {
    if (t[i] == 1) {
      for (int j = x[i]; j <= y[i]; j++) b[j] += z[i];
    } else {
      bool flag = 0;
      for (int j = x[i]; j <= y[i]; j++) {
        if (a[j] + b[j] == z[i]) flag = 1;
      }
      if (!flag) {
        printf("NO\n");
        return 0;
      }
    }
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++) printf("%d%c", a[i], (i == n) ? '\n' : ' ');
  return 0;
}
