#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ks, cnt = 0;
  cin >> ks >> n;
  unsigned int ds[n], bns[n];
  for (int i = 0; i < n; i++) {
    cin >> ds[i] >> bns[i];
  }
  for (int i = 0; i < n;) {
    if (ks > ds[i]) {
      cnt++;
      ds[i] = 100000000;
      ks += bns[i];
      i = 0;
    } else {
      i++;
    }
  }
  if (cnt == n) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
