#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, n;
  cin >> s >> n;
  vector<pair<int, int>> v;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    v.push_back(make_pair(x, y));
  }
  sort(v.begin(), v.end());
  bool win = true;
  for (int j = 0; j < n; j++) {
    if (s <= v[j].first) {
      win = false;
      break;
    } else {
      s += v[j].second;
    }
  }
  if (win)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
