#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, n;
  cin >> s >> n;
  pair<int, int> d[n];
  bool ans = true;
  for (int i = 0; i < n; ++i) {
    cin >> d[i].first >> d[i].second;
  }
  sort(d, d + n);
  for (int i = 0; i < n; ++i) {
    if (s <= d[i].first) {
      cout << "NO";
      return 0;
    }
    s += d[i].second;
  }
  cout << "YES";
  return 0;
}
