#include <bits/stdc++.h>
using namespace std;
int n, s, x, y;
vector<pair<int, int> > v;
int main() {
  scanf("%d %d", &s, &n);
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &x, &y);
    v.push_back(make_pair(x, y));
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < n; i++) {
    if (s <= v[i].first) {
      printf("NO\n");
      return 0;
    } else {
      s += v[i].second;
    }
  }
  printf("YES\n");
  return 0;
}
