#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const int MAXN = 5 * int(1e3) + 10;
const int INF = int(1e9);
int a[MAXN];
int add[MAXN];
int n, m;
int L[MAXN];
int R[MAXN];
bool type[MAXN];
int PAR[MAXN];
bool check() {
  for (int j = 0; j < int(m); j++)
    if (type[j]) {
      int l = L[j];
      int r = R[j];
      int m = PAR[j];
      int mx = -INF;
      for (int i = l; i <= r; i++) mx = max(mx, a[i]);
      if (mx != m) return false;
    } else {
      int l = L[j];
      int r = R[j];
      int d = PAR[j];
      for (int i = l; i <= r; i++) a[i] += d;
    }
  return true;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < int(n); i++) {
    a[i] = INF;
    add[i] = 0;
  }
  for (int j = 0; j < int(m); j++) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int l, r, d;
      scanf("%d%d%d", &l, &r, &d);
      l--;
      r--;
      for (int i = l; i <= r; i++) add[i] += d;
      type[j] = false;
      L[j] = l;
      R[j] = r;
      PAR[j] = d;
    } else {
      assert(t == 2);
      int l, r, m;
      scanf("%d%d%d", &l, &r, &m);
      l--;
      r--;
      for (int i = l; i <= r; i++) {
        if (a[i] > m - add[i]) a[i] = m - add[i];
      }
      type[j] = true;
      L[j] = l;
      R[j] = r;
      PAR[j] = m;
    }
  }
  if (check()) {
    puts("YES");
    for (int i = 0; i < int(n); i++) printf("%d ", a[i] - add[i]);
  } else {
    puts("NO");
  }
  return 0;
}
