#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
} xh[1003];
int cmp(struct node a, struct node b) { return a.x < b.x; }
int main() {
  int n, s, i;
  while (scanf("%d%d", &s, &n) != EOF) {
    for (i = 0; i < n; i++) scanf("%d%d", &xh[i].x, &xh[i].y);
    sort(xh, xh + n, cmp);
    for (i = 0; i < n; i++) {
      if (s > xh[i].x)
        s += xh[i].y;
      else
        break;
    }
    if (i == n)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
