#include <bits/stdc++.h>
using namespace std;
struct Dragon {
  int power;
  int bonus;
};
int main() {
  int power, count;
  cin >> power >> count;
  vector<Dragon> dragons;
  dragons.resize(count);
  for (int i = 0; i < count; i++) {
    cin >> dragons[i].power >> dragons[i].bonus;
  }
  while (!dragons.empty()) {
    bool w = false;
    for (int i = 0; i < dragons.size(); i++) {
      if (power > dragons[i].power) {
        power += dragons[i].bonus;
        dragons.erase(dragons.begin() + i);
        w = true;
      }
    }
    if (!w) {
      cout << "NO";
      exit(0);
    }
  }
  cout << "YES";
  return 0;
}
