#include <bits/stdc++.h>
using namespace std;
pair<int, int> Arr[1000];
int main() {
  int s, n, i = 0;
  cin >> s >> n;
  for (int i = 0; i < n; i++) cin >> Arr[i].first >> Arr[i].second;
  sort(Arr, Arr + n);
  for (int j = 0; j < n; j++) {
    if (s <= Arr[j].first) {
      cout << "NO\n";
      return 0;
    } else
      s += Arr[j].second;
  }
  cout << "YES\n";
  return 0;
}
