#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, n;
  cin >> s >> n;
  int a[n][2];
  bool b[n][2];
  int wrong = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> a[i][j];
      b[i][j] = true;
    }
  }
  for (int i = 0; i < n; i++) {
    if (s <= a[i][0]) {
      b[i][0] = false;
      wrong++;
    } else
      s += a[i][1];
  }
  if (wrong == 0) {
    cout << "YES" << endl;
    return 0;
  }
  do {
    int index = wrong;
    for (int i = 0; i < n; i++) {
      if (b[i][0] == false && s > a[i][0]) {
        b[i][0] = true;
        s += a[i][1];
        wrong--;
      }
    }
    if (index == wrong) {
      cout << "NO" << endl;
      return 0;
    }
  } while (wrong != 0);
  cout << "YES" << endl;
  return 0;
}
