#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned power, n;
  cin >> power >> n;
  vector<unsigned> v[2];
  for (unsigned i = 0; i < n; i++) {
    unsigned a, b;
    cin >> a >> b;
    v[0].push_back(a);
    v[1].push_back(b);
  }
  while (v[0].size() != 0) {
    bool bb = false;
    for (unsigned i = 0; i < v[0].size(); i++)
      if (v[0][i] < power) {
        bb = true;
        power += v[1][i];
        v[0].erase(v[0].begin() + i, v[0].begin() + i + 1);
        v[1].erase(v[1].begin() + i, v[1].begin() + i + 1);
      }
    if (!bb) {
      cout << "NO";
      exit(0);
    }
  }
  cout << "YES";
  return 0;
}
