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