#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> m >> n;
  int k = n;
  int w;
  int* a = new int[n];
  int* b = new int[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  while (k > 0) {
    w = 0;
    for (int i = 0; i < n; i++) {
      if (m > a[i]) {
        m += b[i];
        a[i] = 10030001;
        w = 1;
        k--;
      }
    }
    if (w == 0) {
      cout << "NO";
      exit(0);
    }
  }
  cout << "YES";
  return 0;
}
