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