#include <bits/stdc++.h>
using namespace std;
vector<bool> is_prime;
vector<long long> primes;
void removeZeroes(string &s) {
  string ans;
  for (long long i = 0; i < s.length(); i++) {
    if (s[i] != '0') {
      ans += s[i];
    }
  }
  s = ans;
}
signed main() {
  long long s;
  cin >> s;
  long long n;
  cin >> n;
  vector<pair<long long, long long>> v;
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    v.push_back(make_pair(x, y));
  }
  sort(v.begin(), v.end());
  for (long long i = 0; i < v.size(); i++) {
    if (s > v[i].first) {
      s += v[i].second;
    } else {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
