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