#include <bits/stdc++.h>
using namespace std;
long long const N = 5555, INF = 1e9;
long long n, m, a[N], q1[N], q2[N], q3[N], q4[N], ans[N];
int32_t main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  fill(a, a + N, INF);
  cin >> n >> m;
  for (long long i = 0; i < m; i++) cin >> q1[i] >> q2[i] >> q3[i] >> q4[i];
  for (long long j = m - 1; ~j; j--) {
    long long t = q1[j], l = q2[j], r = q3[j], d = q4[j];
    l--;
    if (t == 2) {
      bool f1 = 0;
      for (long long i = l; i < r; i++)
        if (a[i] >= d) f1 = 1, a[i] = d;
      if (!f1) return cout << "NO", 0;
    } else {
      for (long long i = l; i < r; i++)
        if (a[i] < INF) a[i] -= d;
    }
  }
  copy(a, a + N, ans);
  for (long long j = 0; j < m; j++) {
    long long t = q1[j], l = q2[j], r = q3[j], d = q4[j];
    l--;
    if (t == 2) {
      bool f1 = 0;
      for (long long i = l; i < r; i++)
        if (a[i] == d) f1 = 1;
      if (!f1) return cout << "NO", 0;
    } else {
      for (long long i = l; i < r; i++) a[i] += d;
    }
  }
  cout << "YES\n";
  for (long long i = 0; i < n; i++) cout << ans[i] << ' ';
}
