#include <bits/stdc++.h>
using namespace std;
ifstream fin("B.in");
ofstream fout("B.out");
vector<pair<int, int> > v;
int n, m;
int t[5001], r[5001], l[5001], mm[5001], d[5001], a[5001];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) a[i] = 100000000;
  for (int i = 1; i <= m; ++i) {
    cin >> t[i] >> l[i] >> r[i] >> mm[i];
  }
  for (int i = 1; i <= m; ++i) {
    if (t[i] == 1) {
      for (int j = l[i]; j <= r[i]; ++j) {
        d[j] += mm[i];
      }
    } else {
      for (int j = l[i]; j <= r[i]; ++j) {
        a[j] = min(a[j], mm[i] - d[j]);
      }
    }
  }
  memset(d, 0, sizeof(d));
  for (int i = 1; i <= m; ++i) {
    if (t[i] == 1) {
      for (int j = l[i]; j <= r[i]; ++j) {
        d[j] += mm[i];
      }
    } else {
      int maxv = -100000000;
      for (int j = l[i]; j <= r[i]; ++j) {
        maxv = max(maxv, a[j] + d[j]);
      }
      if (maxv != mm[i]) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= n; ++i) {
    cout << a[i] << " ";
  }
}
