#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, n, i, flag = 0;
  cin >> s >> n;
  int x[n], y[n];
  for (i = 0; i < n; i++) cin >> x[i] >> y[i];
  for (i = 0; i < n; i++)
    if (s > x[i] && x[i]) {
      s = s + y[i];
      x[i] = 0;
      i = -1;
      flag++;
    }
  cout << (flag == n ? "YES" : "NO");
  return 0;
}
