#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
long long v[N];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  ;
  long long s;
  int n;
  while (cin >> s >> n) {
    pair<long long, long long> a[n];
    for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
    sort(a, a + n);
    int sw = 1;
    for (int i = 0; i < n && sw; i++)
      if (s > a[i].first)
        s += a[i].second;
      else
        sw = 0;
    cout << (sw ? "YES" : "NO") << '\n';
  }
}
