#include <bits/stdc++.h>
using namespace std;
int t[5005], l[5005], r[5005], D[5005];
int res[5005], RES[5005], d[5005];
int n, m;
int main() {
  memset(d, 0, sizeof(d));
  cin >> n >> m;
  for (int i = 1; i <= n; i++) res[i] = 1000000000;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d%d", &t[i], &l[i], &r[i], &D[i]);
    if (t[i] == 1) {
      for (int j = l[i]; j <= r[i]; j++) d[j] += D[i];
    } else if (t[i] == 2) {
      for (int j = l[i]; j <= r[i]; j++) res[j] = min(res[j], D[i] - d[j]);
    }
  }
  for (int i = 1; i <= n; i++) RES[i] = res[i];
  for (int i = 1; i <= m; i++) {
    if (t[i] == 1) {
      for (int j = l[i]; j <= r[i]; j++) res[j] += D[i];
    } else {
      int MAX = -1000000000;
      for (int j = l[i]; j <= r[i]; j++) MAX = max(MAX, res[j]);
      if (MAX != D[i]) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) printf("%d ", RES[i]);
  return 0;
}
