#include <bits/stdc++.h>
using namespace std;
struct game {
  int x, y;
};
int cmp(game a, game b) {
  if (a.x < b.x)
    return 1;
  else
    return 0;
}
game a[1010];
int main() {
  int i, n, t;
  while (cin >> t >> n) {
    int k = 0;
    for (i = 0; i < n; i++) cin >> a[i].x >> a[i].y;
    sort(a, a + n, cmp);
    for (i = 0; i < n; i++) {
      if (t > a[i].x)
        t += a[i].y;
      else {
        k = 1;
        break;
      }
    }
    if (k)
      cout << "NO" << endl;
    else
      printf("YES\n");
  }
  return 0;
}
