#include <bits/stdc++.h>
using namespace std;
long long arr2[5010], arr[5010];
long long n, q;
long long t[5010], l[5010], r[5010], d[5010], m[5010], mxinc[5010];
int main() {
  cin >> n >> q;
  for (int i = 0; i < q; ++i) {
    scanf("%lld", &t[i]), scanf("%lld", &l[i]), scanf("%lld", &r[i]);
    --l[i], --r[i];
    if (t[i] == 1)
      scanf("%lld", &d[i]);
    else
      scanf("%lld", &m[i]);
  }
  for (int i = 0; i < q; ++i) {
    if (t[i] == 1) {
      for (int j = l[i]; j <= r[i]; ++j) arr2[j] += d[i];
    } else {
      for (int j = l[i]; j <= r[i]; ++j) {
        if (arr2[j] > m[i]) {
          arr[j] -= arr2[j] - m[i];
          arr2[j] = m[i];
        }
      }
    }
  }
  memset(mxinc, -1, sizeof mxinc);
  for (int i = 0; i < n; ++i) arr2[i] = arr[i];
  for (int i = 0; i < q; ++i) {
    if (t[i] == 1) {
      for (int j = l[i]; j <= r[i]; ++j) arr2[j] += d[i];
    } else {
      for (int j = l[i]; j <= r[i]; ++j) {
        if (mxinc[j] == -1)
          mxinc[j] = m[i] - arr2[j];
        else
          mxinc[j] = min(mxinc[j], m[i] - arr2[j]);
      }
    }
  }
  for (int j = 0; j < n; ++j)
    if (mxinc[j] != -1) arr[j] += mxinc[j];
  for (int i = 0; i < n; ++i) arr2[i] = arr[i];
  for (int i = 0; i < q; ++i) {
    if (t[i] == 1) {
      for (int j = l[i]; j <= r[i]; ++j) {
        arr2[j] += d[i];
      }
    } else {
      long long mx = -2e9;
      for (int j = l[i]; j <= r[i]; ++j) {
        mx = max(mx, arr2[j]);
      }
      if (mx != m[i]) return puts("NO");
    }
  }
  puts("YES");
  for (int i = 0; i < n; ++i) printf("%lld%c", arr[i], " \n"[i == n - 1]);
}
