#include <bits/stdc++.h>
using namespace std;
const int inf = 2000000000;
static inline int Rint() {
  struct X {
    int dig[256];
    X() {
      for (int i = '0'; i <= '9'; ++i) dig[i] = 1;
      dig['-'] = 1;
    }
  };
  static X fuck;
  int s = 1, v = 0, c;
  for (; !fuck.dig[c = getchar()];)
    ;
  if (c == '-')
    s = 0;
  else if (fuck.dig[c])
    v = c ^ 48;
  for (; fuck.dig[c = getchar()]; v = v * 10 + (c ^ 48))
    ;
  return s ? v : -v;
}
template <typename T>
static inline void cmax(T& a, const T& b) {
  if (b > a) a = b;
}
template <typename T>
static inline void cmin(T& a, const T& b) {
  if (b < a) a = b;
}
const int maxn = 100005;
struct Pt {
  int t, l, r, v;
};
Pt cmds[5005];
long long data[5005];
long long L[5005], R[5005];
int check_max(int n, int l, int r, int v) {
  int all_less = 1;
  for (int i = l; i <= r; ++i) {
    all_less = all_less && R[i] < v - data[i];
    R[i] = min(R[i], v - data[i]);
    if (R[i] < L[i]) return 0;
  }
  if (all_less) return 0;
  return 1;
}
int check_max1(int n, int l, int r, int v) {
  int all_less = 1;
  for (int i = l; i <= r; ++i) {
    all_less = all_less && R[i] < v - data[i];
  }
  if (all_less) return 0;
  return 1;
}
int main() {
  const int n = Rint(), m = Rint();
  for (int i = 1; i <= n; ++i) L[i] = -1000000000, R[i] = 1000000000;
  int ok = 1;
  for (int id = 0; id < m; ++id) {
    const int cmd = Rint(), l = Rint(), r = Rint(), v = Rint();
    cmds[id].t = cmd;
    cmds[id].l = l;
    cmds[id].r = r;
    cmds[id].v = v;
    if (cmd == 1) {
      for (int i = l; i <= r; ++i) {
        data[i] += v;
      }
    } else {
      if (!check_max(n, l, r, v)) {
        ok = 0;
        break;
      }
    }
  }
  if (!ok) {
    puts("NO");
    return 0;
  }
  ok = 1;
  memset(data, 0, sizeof data);
  for (int id = 0; id < m; ++id) {
    const int cmd = cmds[id].t, l = cmds[id].l, r = cmds[id].r, v = cmds[id].v;
    if (cmd == 1) {
      for (int i = l; i <= r; ++i) {
        data[i] += v;
      }
    } else {
      if (!check_max1(n, l, r, v)) {
        ok = 0;
        break;
      }
    }
  }
  if (!ok) {
    puts("NO");
    return 0;
  }
  puts("YES");
  for (int i = 1; i <= n; ++i) printf("%I64d ", R[i]);
  puts("");
  return 0;
}
