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