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