#include <bits/stdc++.h>
int x[1001];
int y[1001];
bool isf[1001];
int main() {
  int s, n;
  scanf("%d %d", &s, &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", &x[i], &y[i]);
  }
  memset(isf, false, sizeof(bool) * 1001);
  int t = s;
  while (1) {
    int k = 0, m = -1;
    bool isl = false;
    for (int i = 1; i <= n; i++) {
      if (!isf[i]) {
        isl = true;
      }
      if (!isf[i] && x[i] < t) {
        if (m < y[i]) {
          m = y[i];
          k = i;
        }
      }
    }
    if (k == 0 && isl) {
      printf("NO\n");
      break;
    }
    if (!isl) {
      printf("YES\n");
      break;
    } else {
      t += m;
      isf[k] = true;
    }
  }
  return 0;
}
