#include <bits/stdc++.h>
using namespace std;
int bugf;
inline int in() {
  scanf("%d", &bugf);
  return bugf;
}
const double eps = 1e-7;
int round_(double a) {
  if (a < eps)
    return (int)(a - 0.5);
  else
    return (int)(a + 0.5);
}
double dist2(double x1, double y1, double x2, double y2) {
  return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
}
int f(double x) {
  if (fabs(x) < eps) return 0;
  if (x < 0) return -1;
  return 1;
}
int main() {
  int s = in(), n = in();
  long long res = 0;
  vector<pair<int, int> > a;
  for (int i = 0; i < n; ++i) {
    int di = in(), b = in();
    pair<int, int> cur;
    cur.first = di;
    cur.second = b;
    a.push_back(cur);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j)
      if (a[j].first != -1 && a[j].first < s) {
        a[j].first = -1;
        ++res;
        s += a[j].second;
      }
  }
  if (res == n) {
    puts("YES");
  } else
    puts("NO");
  return 0;
}
