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