#include <bits/stdc++.h>
using namespace std;
template <class It>
void dptab(It b, It e, const char* f = "%d ") {
  if (1) {
    for (It it = b; it != e; ++it)
      if (1) {
        printf("\033[31m");
        printf(f, *it);
        printf("\033[0m");
      };
    if (1) {
      printf("\033[31m");
      printf("\n");
      printf("\033[0m");
    };
  }
}
struct instruction {
  int type;
  int l, r;
  int x;
};
const int ADD = 1, MAX = 2;
int delta[5000];
int max_value[5000];
int n, m;
vector<instruction> instr;
bool check() {
  vector<int> copy;
  for (int i = (0); i < (n); ++i) copy.push_back(max_value[i]);
  for (int i = (0); i < (m); ++i) {
    instruction in = instr[i];
    if (in.type == ADD) {
      for (int j = (in.l); j < (in.r + 1); ++j) copy[j] += in.x;
    } else {
      int compute = -1e9;
      for (int j = (in.l); j < (in.r + 1); ++j) compute = max(compute, copy[j]);
      if (compute != in.x) return false;
    }
  }
  return true;
}
int main() {
  scanf("%d", &n);
  scanf("%d", &m);
  for (int i = (0); i < (m); ++i) {
    instruction in;
    scanf("%d", &in.type);
    scanf("%d", &in.l);
    scanf("%d", &in.r);
    scanf("%d", &in.x);
    --in.l, --in.r;
    instr.push_back(in);
  }
  for (int i = (0); i < (n); ++i) max_value[i] = 1e9;
  for (int i = (0); i < (m); ++i) {
    instruction in = instr[i];
    if (in.type == ADD) {
      for (int j = (in.l); j < (in.r + 1); ++j) delta[j] += in.x;
    } else {
      for (int j = (in.l); j < (in.r + 1); ++j)
        max_value[j] = min(max_value[j], in.x - delta[j]);
    }
  }
  if (check()) {
    printf("YES\n");
    for (int i = (0); i < (n); ++i) printf("%d ", max_value[i]);
    printf("\n");
  } else
    printf("NO\n");
  return 0;
}
