#include <bits/stdc++.h>
using namespace std;
int main() {
  bool www = true;
  long long n, s, a, b, d = -1, p = 0, q = 0, j;
  cin >> n >> s;
  vector<pair<long long, long long>> v;
  for (int i = 0; i < s; i++) {
    cin >> a >> b;
    v.push_back(make_pair(a, b));
  }
  for (int i = 0; i < v.size(); i++) {
    swap(v[i].first, v[i].second);
  }
  sort(v.rbegin(), v.rend());
  for (int i = 0; i < v.size(); i++) {
    swap(v[i].first, v[i].second);
  }
  for (j = 0; j < s - 1; j++) {
    d == -1;
    for (int i = 0; i < v.size(); i++) {
      if (n <= v[i].first) {
        d = -1;
      }
      if (n > v[i].first) {
        d = v[i].second;
        p = i;
        break;
      }
    }
    if (d == -1) {
      www = false;
      break;
      continue;
    }
    v.erase(v.begin() + p);
    n = n + d;
  }
  if (n <= v[0].first) {
    www = false;
  }
  if (www == true) cout << "YES" << endl;
  if (www == false) cout << "NO" << endl;
  return 0;
}
