#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int s, n;
  scanf("%lld%lld", &s, &n);
  long long int ar[10001], ar2[10001];
  for (long long int i = 0; i < n; i++) scanf("%lld%lld", &ar[i], &ar2[i]);
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < n; j++) {
      if (s > ar[j] && ar[j] != -10) {
        s = s + ar2[j];
        ar[j] = -10;
      }
    }
  }
  for (long long int i = 0; i < n; i++) {
    if (ar[i] != -10) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  return 0;
}
