#include <bits/stdc++.h>
using namespace std;
long long int lim = 1000000000;
struct oper {
  int op, lhs, rhs, num;
};
int main() {
  int size, num_ops;
  cin >> size >> num_ops;
  vector<long long int> cur(size);
  vector<pair<long long int, long long int>> limits(size, make_pair(-lim, lim));
  vector<oper> ops(num_ops);
  for (int n = 0; n < num_ops; n++) {
    auto& cur = ops[n];
    cin >> cur.op >> cur.lhs >> cur.rhs >> cur.num;
    cur.lhs--;
    cur.rhs--;
  }
  for (int n = 0; n < num_ops; n++) {
    const auto& tmp = ops[n];
    int op = tmp.op, lhs = tmp.lhs, rhs = tmp.rhs, num = tmp.num;
    if (op == 1) {
      for (int m = lhs; m <= rhs; m++) cur[m] += num;
    } else if (op == 2) {
      for (int m = lhs; m <= rhs; m++) {
        limits[m].second = min(limits[m].second, num - cur[m]);
      }
    }
  }
  bool ok = true;
  for (int m = 0; m < size; m++)
    if (limits[m].second < limits[m].first) {
      ok = false;
      break;
    }
  if (ok) {
    for (int n = 0; n < size; n++) cur[n] = limits[n].second;
    for (int n = 0; n < num_ops; n++) {
      const auto& tmp = ops[n];
      int op = tmp.op, lhs = tmp.lhs, rhs = tmp.rhs, num = tmp.num;
      if (op == 1) {
        for (int m = lhs; m <= rhs; m++) cur[m] += num;
      } else if (op == 2) {
        bool found_max = false;
        for (int m = lhs; m <= rhs; m++) {
          if (cur[m] == num) found_max = true;
        }
        if (!found_max) {
          ok = false;
          break;
        }
      }
    }
  }
  if (ok) {
    cout << "YES" << endl;
    for (int n = 0; n < size; n++) cout << limits[n].second << " ";
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
