#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const double pi = 3.14159265358979323846;
int n, m;
vector<vector<int> > zapr;
bool read() {
  if (!(cin >> n >> m)) return false;
  zapr.resize(m);
  for (int i = 0; i < int(m); ++i) {
    for (int j = 0; j < int(4); ++j) {
      int a;
      cin >> a;
      zapr[i].push_back(a);
    }
    zapr[i][1]--;
    zapr[i][2]--;
  }
  return true;
}
void solve() {
  vector<int> ans(n, 1e9);
  for (int i = m - 1; i >= 0; --i) {
    if (zapr[i][0] == 1) {
      for (int j = zapr[i][1]; j <= zapr[i][2]; ++j)
        ans[j] = min(1000000000, ans[j] - zapr[i][3]);
    } else {
      for (int j = zapr[i][1]; j <= zapr[i][2]; ++j)
        ans[j] = min(ans[j], zapr[i][3]);
    }
  }
  vector<int> check(ans);
  bool ok = true;
  for (int i = 0; i < int(m); ++i) {
    if (zapr[i][0] == 1) {
      for (int j = zapr[i][1]; j <= zapr[i][2]; ++j) ans[j] += zapr[i][3];
    } else {
      int res = -1e9;
      for (int j = zapr[i][1]; j <= zapr[i][2]; ++j) res = max(res, ans[j]);
      if (res != zapr[i][3] || res > 1e9) ok = false;
    }
  }
  if (ok) {
    cout << "YES" << endl;
    for (int i = 0; i < int(n); ++i) cout << check[i] << ' ';
  } else
    cout << "NO" << endl;
}
int main() {
  while (read()) solve();
  return 0;
}
