#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, n;
  cin >> s >> n;
  int dragon, bouns;
  long long sum = s;
  bool res = false;
  multimap<int, int> map1;
  for (int i = 0; i < n; i++) {
    cin >> dragon >> bouns;
    map1.insert(pair<int, int>(dragon, bouns));
  }
  for (multimap<int, int>::iterator it = map1.begin(); it != map1.end(); it++) {
    if (it->first < sum) {
      sum += it->second;
    } else {
      res = true;
      break;
    }
  }
  if (res)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
