#include <bits/stdc++.h>
using namespace std;
const long long p = 1e9 + 7;
const long double pi = 3.1415926535898;
int main() {
  int s, n;
  cin >> s >> n;
  vector<pair<int, int> > a(n);
  for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
  sort(a.begin(), a.end());
  for (int i = 0; i < n; i++) {
    if (a[i].first >= s) {
      cout << "NO";
      return 0;
    }
    s += a[i].second;
  }
  cout << "YES";
  return 0;
}
