#include <bits/stdc++.h>
using namespace std;
long long ans, res, flag;
long double cem;
int main() {
  int second, n;
  cin >> second >> n;
  vector<pair<int, int> > v;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    v.push_back({a, b});
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    int bir = v[i].first, iki = v[i].second;
    if (second > bir) {
      second += iki;
    } else {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}
