#include <bits/stdc++.h>
using namespace std;
vector<int> search(int n, vector<int> T, vector<pair<int, int> > P,
                   vector<int> M) {
  vector<int> ans(n, 0), mark(n, 0);
  for (int k = 0; k < T.size(); k++) {
    int ti = T[k];
    int li = P[k].first;
    int ri = P[k].second;
    int mi = M[k];
    for (int i = li; i < ri + 1; i++) {
      if (ti == 1 and mark[i]) ans[i] += mi;
      if (ti == 2) {
        if (mark[i])
          ans[i] = min(ans[i], mi);
        else {
          ans[i] = mi;
          mark[i] = 1;
        }
      }
    }
  }
  for (int k = 0; k < T.size(); k++)
    if (T[k] == 1) {
      int li = P[k].first;
      int ri = P[k].second;
      int mi = M[k];
      for (int i = li; i < ri + 1; i++)
        if (mark[i]) ans[i] -= mi;
    }
  return ans;
}
bool check(vector<int> T, vector<pair<int, int> > P, vector<int> M,
           vector<int> ans) {
  for (int k = 0; k < T.size(); k++) {
    int ti = T[k];
    int li = P[k].first;
    int ri = P[k].second;
    int mi = M[k];
    int mx = INT_MIN;
    for (int i = li; i < ri + 1; i++) {
      if (ti == 1)
        ans[i] += mi;
      else
        mx = max(mx, ans[i]);
    }
    if (ti == 2 and mx != mi) return false;
  }
  return true;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> T;
  vector<pair<int, int> > P;
  vector<int> M;
  for (int i = 0; i < m; i++) {
    int ti, li, ri, mi;
    cin >> ti >> li >> ri >> mi;
    li--;
    ri--;
    T.push_back(ti);
    P.push_back(make_pair(li, ri));
    M.push_back(mi);
  }
  vector<int> ans = search(n, T, P, M);
  if (!check(T, P, M, ans)) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
