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