#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y;
  cin >> x >> y;
  pair<int, int> p[y];
  for (int i = 0; i < y; i++) cin >> p[i].first >> p[i].second;
  sort(p, p + y);
  for (int i = 0; i < y; i++) {
    if (p[i].first < x)
      x += p[i].second;
    else {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
}
