#include <bits/stdc++.h>
using namespace std;
const int N = 1e3;
pair<int, int> a[N];
int main() {
  int s, n;
  scanf("%d %d", &s, &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d %d", &a[i].first, &a[i].second);
  }
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    if (s > a[i].first)
      s += a[i].second;
    else {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  return 0;
}
