#include <bits/stdc++.h>
using namespace std;
struct el {
  long long added;
  long long current;
  unordered_set<int> resolved;
  bool ass;
  el() : added(0), current(0), ass(false) {}
};
int smax[5005] = {0};
el elems[5005];
int main() {
  int n, m, ti, li, ri, di;
  vector<int> all_maxes;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d %d %d %d", &ti, &li, &ri, &di);
    if (ti == 1) {
      for (int j = li - 1; j <= ri - 1; ++j) {
        elems[j].current += di;
        elems[j].added += di;
      }
    } else if (ti == 2) {
      all_maxes.push_back(i);
      for (int j = li - 1; j <= ri - 1; ++j) {
        el &curr = elems[j];
        int &mmx = smax[i];
        if (!curr.ass) {
          curr.current = di;
          curr.ass = true;
          curr.resolved.insert(i);
          ++mmx;
        } else {
          if (curr.current == di) {
            curr.resolved.insert(i);
            ++mmx;
          } else if (curr.current > di) {
            for (auto it = curr.resolved.begin(); it != curr.resolved.end();
                 ++it)
              --smax[*it];
            curr.resolved.clear();
            curr.current = di;
            curr.resolved.insert(i);
            ++mmx;
          }
        }
      }
    }
  }
  for (auto it = all_maxes.cbegin(); it != all_maxes.cend(); ++it) {
    if (smax[*it] <= 0) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  for (int i = 0; i < n; ++i) {
    printf("%d ", elems[i].current - elems[i].added);
  }
  return 0;
}
