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