#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, s;
  cin >> s >> n;
  vector<pair<long long, long long>> v(n);
  for (long long int i = 0; i < n; i++) {
    cin >> v[i].first >> v[i].second;
  }
  sort(v.begin(), v.end());
  for (long long int i = 0; i < n; i++) {
    if (s > v[i].first) {
      s += v[i].second;
    } else {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
