#include <bits/stdc++.h>
using namespace std;
long long a[500500], b[500500], mt;
int n, tq[500500], tl[500500], tr[500500], td[500500], l, r, d, q, m;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) a[i] = 1000000000;
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d%d", &q, &l, &r, &d);
    --l;
    --r;
    if (q == 1) {
      for (int j = l; j <= r; j++) {
        a[j] += d;
        b[j] += d;
      }
    } else {
      for (int j = l; j <= r; j++)
        if (d < a[j]) a[j] = d;
    }
    tq[i] = q;
    tl[i] = l;
    tr[i] = r;
    td[i] = d;
  }
  for (int i = 0; i < n; i++) {
    a[i] -= b[i];
    b[i] = a[i];
  }
  for (int i = 0; i < m; i++) {
    q = tq[i];
    l = tl[i];
    r = tr[i];
    d = td[i];
    if (q == 1) {
      for (int j = l; j <= r; j++) a[j] += d;
    } else {
      long long mt = -1000000000000000000LL;
      for (int j = l; j <= r; j++)
        if (a[j] > mt) mt = a[j];
      if (mt != d) {
        puts("NO");
        return 0;
      }
    }
  }
  for (int i = 0; i < n; i++)
    if ((b[i] < -1000000000) || (b[i] > 1000000000)) {
      puts("NO");
      return 0;
    }
  puts("YES");
  for (int i = 0; i < n; i++) cout << b[i] << " ";
  puts("");
}
