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