#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse4")
using namespace std;
long long a[5005], u[5005], b[5005], init[5005];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  long long i;
  long long j, ch[m + 5], l[m + 5], r[m + 5], d[m + 5];
  for (i = 0; i < m; i++) cin >> ch[i] >> l[i] >> r[i] >> d[i];
  for (i = 0; i < m; i++) {
    if (ch[i] == 1) {
      for (j = l[i]; j <= r[i]; j++) u[j] += d[i];
    } else {
      long long f = 0;
      for (j = l[i]; j <= r[i]; j++)
        if (f == 0) {
          if (init[j] == 1)
            f = 1;
          else {
            init[j] = 1;
            f = 1;
            a[j] = d[i] - u[j];
          }
        } else {
          a[j] = d[i] - u[j];
          init[j] = 1;
        }
    }
  }
  for (i = 1; i <= n; i++) b[i] = a[i];
  for (i = 0; i < m; i++) {
    long long maxi = -1e18;
    if (ch[i] == 2) {
      for (j = l[i]; j <= r[i]; j++) {
        if (b[j] > d[i]) {
          long long x = b[j] - d[i];
          b[j] = d[i];
          a[j] -= x;
        }
        maxi = max(maxi, b[j]);
      }
      if (maxi != d[i]) break;
    } else {
      for (j = l[i]; j <= r[i]; j++) b[j] += d[i];
    }
  }
  for (i = 1; i <= n; i++) b[i] = a[i];
  for (i = 0; i < m; i++) {
    long long maxi = -1e18;
    if (ch[i] == 2) {
      for (j = l[i]; j <= r[i]; j++) maxi = max(maxi, b[j]);
      if (maxi != d[i]) break;
    } else {
      for (j = l[i]; j <= r[i]; j++) b[j] += d[i];
    }
  }
  if (i < m)
    cout << "NO";
  else {
    cout << "YES\n";
    for (i = 1; i <= n; i++) cout << a[i] << " ";
  }
  return 0;
}
