#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, n, x, y;
  bool flag = 0;
  multimap<int, int, greater<int>> v;
  cin >> s >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x >> y;
    v.insert(pair<int, int>(x, y));
  }
  for (auto iter = v.rbegin(); iter != v.rend(); ++iter) {
    if (s > iter->first) {
      s += iter->second;
    } else {
      flag = 1;
      break;
    }
  }
  if (flag == 0) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
