#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 7;
int main() {
  int s, n;
  cin >> s >> n;
  vector<pair<int, int>> dra;
  for (int i = 0; i < n; ++i) {
    int a, b;
    cin >> a >> b;
    dra.push_back(make_pair(a, b));
  }
  sort(dra.begin(), dra.end());
  for (int i = 0; i < n; ++i) {
    if (dra[i].first < s) {
      s += dra[i].second;
    } else {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
