#include <bits/stdc++.h>
using namespace std;
struct dragon {
  int sila;
  int dodatek;
};
bool operator<(dragon A, dragon B) { return A.sila < B.sila; }
int main() {
  int s, n;
  cin >> s >> n;
  vector<dragon> D(n);
  for (int i = 0; i < n; i++) {
    cin >> D[i].sila >> D[i].dodatek;
  }
  sort(D.begin(), D.end());
  for (int p = 0; p < n; p++) {
    if (s > D[p].sila)
      s += D[p].dodatek;
    else {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}
