#include <bits/stdc++.h>
using namespace std;
long long int power(long long int a, long long int p) {
  long long int ans = 1;
  while (p > 0) {
    if (p % 2) {
      ans *= a;
      ans %= 1000000007;
    }
    a *= a;
    a %= 1000000007;
    p /= 2;
  }
  return ans % 1000000007;
}
vector<long long int> getbinary(long long int first) {
  vector<long long int> bin(2000, 0);
  int iter = 0;
  while (first > 0) {
    bin[iter] = first % 2;
    iter++;
    first /= 2;
  }
  return bin;
}
struct bun {
  long long int a, b, c, d;
};
bool comparator(bun &a, bun &b) { return b.c * a.d > a.c * b.d; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  long long int t[m], l[m], r[m], val[m];
  vector<long long int> a(n + 1, 0), s(n + 1, 1000000000);
  for (int i = 0; i < m; i++) {
    cin >> t[i] >> l[i] >> r[i] >> val[i];
    if (t[i] == 1) {
      for (int j = l[i]; j <= r[i]; j++) {
        a[j] += val[i];
      }
    } else {
      for (int j = l[i]; j <= r[i]; j++) {
        s[j] = min(s[j], val[i] - a[j]);
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    a[i] = s[i];
  }
  for (int i = 0; i < m; i++) {
    if (t[i] == 1) {
      for (int j = l[i]; j <= r[i]; j++) {
        a[j] += val[i];
      }
    } else {
      long long int maxval = -1000000000;
      for (int j = l[i]; j <= r[i]; j++) {
        maxval = max(maxval, a[j]);
      }
      if (maxval != val[i]) {
        cout << "NO\n";
        return 0;
      }
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) {
    cout << s[i] << " ";
  }
  cout << endl;
}
