#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  long long t = 1;
  while (t--) {
    long long n, k;
    cin >> k >> n;
    vector<pair<long long, long long> > v(n);
    for (long long i = 0; i < n; i++) {
      cin >> v[i].first >> v[i].second;
    }
    sort(v.begin(), v.end());
    for (long long i = 0; i < n; i++) {
      if (k <= v[i].first) {
        cout << "NO\n";
        return 0;
      } else {
        k += v[i].second;
      }
    }
    cout << "YES\n";
  }
  return 0;
}
