#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, n, c = 0;
  cin >> s >> n;
  pair<int, int> d[n];
  for (int i = 0; i < n; i++) {
    cin >> d[i].first >> d[i].second;
  }
  sort(d, d + n);
  for (int i = 0; i < n; i++) {
    if (s > d[i].first) {
      s += d[i].second;
      c++;
    } else
      break;
  }
  cout << ((c == n) ? "YES" : "NO");
}
