#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
} e[100005];
bool cmp(node a, node b) {
  if (a.x == b.x) return a.y > b.y;
  return a.x < b.x;
}
int main() {
  int s, n;
  scanf("%d%d", &s, &n);
  for (int i = 1; i <= n; i++) {
    cin >> e[i].x >> e[i].y;
  }
  sort(e + 1, e + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    if (e[i].x < s) {
      s += e[i].y;
    } else {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}
