#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long s, n;
  cin >> s >> n;
  pair<long long, long long> p[n + 5];
  for (int i = 0; i < n; i++) {
    cin >> p[i].first >> p[i].second;
  }
  sort(p, p + n);
  for (int i = 0; i < n; i++) {
    if (s <= p[i].first) return cout << "NO", 0;
    s += p[i].second;
  }
  cout << "YES";
}
