#include <bits/stdc++.h>
using namespace std;
long long n, ans;
string str;
long long solve() {
  long long s;
  cin >> s >> n;
  long long x[n], y[n], z[n];
  for (long long i = 0; i <= n - 1; ++i) {
    cin >> x[i] >> y[i];
    z[i] = 0;
  }
  long long f = 0;
  while (1) {
    f = 0;
    for (long long i = 0; i <= n - 1; ++i) {
      if (z[i] == 0 && s > x[i]) {
        s += y[i];
        z[i] = 1;
        f = 1;
      }
    }
    if (f == 0) break;
  }
  long long t = 0;
  for (long long i = 0; i <= n - 1; ++i) {
    if (z[i]) t++;
  }
  if (t == n)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
signed main() {
  ios::sync_with_stdio(0);
  long long t = 1;
  while (t--) solve();
  return 0;
}
