#include <bits/stdc++.h>
using namespace std;
int arr[5000];
int now[5000];
int t[5000];
int a[5000];
int b[5000];
int c[5000];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    arr[i] = 1000000000;
    now[i] = 0;
  }
  for (int i = 0; i < m; i++) {
    scanf("%d %d %d %d", &t[i], &a[i], &b[i], &c[i]);
    a[i]--;
    b[i]--;
    if (t[i] == 1) {
      for (int q = a[i]; q <= b[i]; q++) {
        now[q] += c[i];
      }
    } else {
      for (int q = a[i]; q <= b[i]; q++) {
        arr[q] = min(arr[q], c[i] - now[q]);
      }
    }
  }
  for (int i = 0; i < n; i++) {
    now[i] = 0;
  }
  bool ok = true;
  for (int i = 0; i < m; i++) {
    if (t[i] == 1) {
      for (int q = a[i]; q <= b[i]; q++) {
        now[q] += c[i];
      }
    } else {
      bool got = false;
      for (int q = a[i]; q <= b[i]; q++) {
        if (arr[q] + now[q] == c[i]) got = true;
      }
      if (!got) ok = false;
    }
  }
  for (int i = 0; i < n; i++) {
    if (arr[i] < -1000000000) {
      ok = false;
    }
  }
  if (!ok) {
    printf("NO\n");
  } else {
    printf("YES\n");
    for (int i = 0; i < n; i++) {
      printf("%d ", arr[i]);
    }
  }
  return 0;
}
