#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, n;
  cin >> s >> n;
  int x[1001], y[1001];
  bool a[1001];
  for (int i = 1; i <= n; i++) {
    a[i] = true;
  }
  for (int i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
  }
  bool tr = true;
  int k = 1;
  while (tr) {
    k = 1;
    for (int i = 1; i <= n; i++) {
      if (a[i]) {
        if (s > x[i]) {
          s = s + y[i];
          a[i] = false;
          k++;
        }
      }
    }
    int z = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i] == false) {
        z++;
      }
    }
    if (z == n) {
      break;
    }
    if (k == 1) {
      tr = false;
    }
  }
  if (tr) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
