#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, n;
  cin >> s >> n;
  int a[1001][1001];
  int b[1001];
  for (int i = 0; i < n; i++) {
    cin >> a[i][0] >> a[i][1];
    b[i] = a[i][0];
  }
  sort(b, b + n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[j][0] == b[i]) {
        if (s <= a[j][0]) {
          cout << "NO";
          return 0;
        } else {
          s = s + a[j][1];
          a[j][0] = -1;
          break;
        }
      }
    }
  }
  cout << "YES";
  return 0;
}
