#include <bits/stdc++.h>
using namespace std;
bool lucky(long long n) {
  set<long long> s;
  while (n > 0) {
    s.insert(n % 10);
    n /= 10;
  }
  for (long long i = 0; i <= 9; i++) {
    if (i == 4 || i == 7)
      continue;
    else if (s.count(i) > 0)
      return false;
  }
  s.clear();
  return true;
}
int main() {
  long long s, n;
  cin >> s >> n;
  priority_queue<pair<long long, long long>> p;
  for (long long i = 0; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    p.push({-1 * a, b});
  }
  long long power = s;
  bool no = false;
  for (long long i = 0; i < n; i++) {
    auto pp = p.top();
    p.pop();
    if (power <= -1 * pp.first) {
      no = true;
      break;
    } else {
      power += pp.second;
    }
  }
  if (no)
    cout << "NO\n";
  else
    cout << "YES\n";
}
