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