#include <bits/stdc++.h>
using namespace std;
bool compare_points(pair<int, int> p1, pair<int, int> p2) {
  if (p1.first - p2.first != 0)
    return p1.first < p2.first;
  else
    return p1.second < p2.second;
}
int main() {
  int s, n;
  cin >> s >> n;
  vector<pair<int, int>> dragons;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    dragons.push_back(make_pair(x, y));
  }
  sort(dragons.begin(), dragons.end(), compare_points);
  for (int i = 0; i < n; i++) {
    pair<int, int> val = dragons[i];
    if (s > val.first) {
      s += val.second;
    } else if (s <= val.first) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
