#include <bits/stdc++.h>
using namespace std;
int main() {
  pair<int, int> p[10000];
  int s, n, x, y;
  bool f = 0;
  cin >> s >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    p[i] = make_pair(x, y);
  }
  sort(p, p + n);
  for (int i = 0; i < n; i++) {
    if (s > p[i].first)
      s += p[i].second;
    else {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
