#include <bits/stdc++.h>
using namespace std;
const int N = 5050;
int n, m;
const long long int INF = ((1 << 30) * 1ll * 2) - 1;
long long int t[N];
long long int s[N];
struct Event {
  long long int type, l, r, v;
  Event() {}
  Event(int t, int ll, int rr, int vv) : type(t), l(ll), r(rr), v(vv){};
};
bool used[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  vector<Event> v(m);
  for (int i = 0; i < m; ++i) {
    cin >> v[i].type >> v[i].l >> v[i].r >> v[i].v;
  }
  for (int i = m - 1; i >= 0; --i) {
    if (v[i].type == 1) {
      for (int j = v[i].l; j <= v[i].r; ++j) {
        t[j] -= v[i].v;
      }
    } else {
      for (int j = v[i].l; j <= v[i].r; ++j) {
        if (used[j])
          t[j] = min(v[i].v, t[j]);
        else {
          t[j] = v[i].v;
          used[j] = true;
        }
      }
    }
  }
  for (int i = 0; i <= n; ++i) {
    s[i] = t[i];
  }
  for (int i = 0; i < m; ++i) {
    if (v[i].type == 1) {
      for (int j = v[i].l; j <= v[i].r; ++j) {
        s[j] += v[i].v;
      }
    } else {
      long long int ans = s[v[i].l];
      for (int j = v[i].l + 1; j <= v[i].r; ++j) {
        ans = max(ans, s[j]);
      }
      if (ans != v[i].v) {
        cout << "NO";
        return 0;
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (max(t[i], -t[i]) > 1000000000) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; ++i) {
    cout << t[i] << " ";
  }
  return 0;
}
