#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-8;
int maxi[5005];
int add[5005];
int op[5005], l[5005], r[5005], val[5005];
int main() {
  ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  memset(add, 0, sizeof(add));
  ;
  memset(maxi, 63, sizeof(maxi));
  ;
  for (int i = 0; i <= n; i++) maxi[i] = 1e9;
  for (int i = 0; i < m; i++) {
    cin >> op[i] >> l[i] >> r[i] >> val[i];
    if (op[i] == 1) {
      for (int j = l[i]; j <= r[i]; j++) add[j] += val[i];
    } else {
      for (int j = l[i]; j <= r[i]; j++)
        maxi[j] = min(maxi[j], val[i] - add[j]);
    }
  }
  memset(add, 0, sizeof(add));
  ;
  for (int i = 0; i < m; i++) {
    if (op[i] == 1) {
      for (int j = l[i]; j <= r[i]; j++) add[j] += val[i];
    } else {
      int mx = -(1e9);
      for (int j = l[i]; j <= r[i]; j++) {
        mx = max(mx, maxi[j] + add[j]);
      }
      if (mx != val[i]) {
        cout << "NO\n";
        return 0;
      }
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) cout << maxi[i] << " ";
  return 0;
}
