#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int t, i, j, n;
  int arr[5002] = {0}, inc[5002] = {0}, mx[5002] = {0};
  int op[5002][4];
  int mxm, l, r, d, num, m;
  cin >> n >> m;
  for (i = 1; i <= n; ++i) arr[i] = 100000000;
  for (i = 0; i < m; ++i) {
    cin >> t >> l >> r >> d;
    op[i][0] = t;
    op[i][1] = l;
    op[i][2] = r;
    op[i][3] = d;
    if (t == 1) {
      for (j = l; j <= r; ++j) {
        inc[j] += d;
      }
    } else {
      for (j = l; j <= r; ++j) {
        num = d - inc[j];
        arr[j] = min(arr[j], num);
      }
    }
  }
  for (i = 1; i <= n; ++i) mx[i] = arr[i];
  for (i = 0; i < m; ++i) {
    if (op[i][0] == 1) {
      for (j = op[i][1]; j <= op[i][2]; ++j) mx[j] += op[i][3];
    } else {
      mxm = -100000000;
      for (j = op[i][1]; j <= op[i][2]; ++j) mxm = max(mxm, mx[j]);
      if (mxm != op[i][3]) {
        break;
      }
    }
  }
  if (i < m) {
    cout << "NO";
  } else {
    cout << "YES\n";
    for (i = 1; i <= n; ++i) {
      cout << arr[i] << " ";
    }
  }
  return 0;
}
