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