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