#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[1001];
int main() {
  int second, n, x, y;
  cin >> second >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    a[i] = make_pair(x, y);
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    if (a[i].first >= second) {
      cout << "NO";
      return 0;
    }
    second += a[i].second;
  }
  cout << "YES";
}
