#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, n;
  while (scanf("%d%d", &s, &n) == 2) {
    vector<int> strength, bonus;
    int i, j, l = n, ll = 0;
    while (n--) {
      int x, y;
      scanf("%d%d", &x, &y);
      strength.push_back(x);
      bonus.push_back(y);
    }
    for (i = 0; i < l; i++) {
      for (j = 0; j < l; j++) {
        if (s > strength.at(j) && strength.at(j) != 0) {
          s += bonus.at(j);
          strength.at(j) = 0;
          ll++;
        }
      }
    }
    if (strength.size() == ll)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
