#include <bits/stdc++.h>
using namespace std;
void solve() {
  int s, n;
  cin >> s >> n;
  vector<pair<int, int>> mp(n);
  for (int i = 0; i < n; ++i) {
    int temp1, temp2;
    cin >> temp1 >> temp2;
    mp[i] = {temp1, temp2};
  }
  sort(mp.begin(), mp.end());
  for (int i = 0; i < n; ++i) {
    if (s <= mp[i].first) {
      cout << "NO" << endl;
      return;
    }
    s += mp[i].second;
  }
  cout << "YES" << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
