#include <bits/stdc++.h>
using namespace std;
bool comp(int a, int b) { return a > b; }
bool isvowel(char c) {
  return (c == 'a' || c == 'A' || c == 'e' || c == 'E' || c == 'i' ||
          c == 'I' || c == 'o' || c == 'O' || c == 'u' || c == 'U');
}
int a[1001];
void swaps(int *a, int *b) {
  int temp = *a;
  *a = *b;
  *b = temp;
}
void f(int size) {
  if (size == 1) return;
  sort(a, a + size - 1);
  swaps(&a[size - 1], &a[size - 2]);
  f(size - 1);
}
int main() {
  int n, s;
  scanf("%d %d", &s, &n);
  ;
  std::vector<pair<int, int> > a;
  int x, y;
  for (int i = 0; i < n; ++i) {
    scanf("%d %d", &x, &y);
    ;
    a.push_back(make_pair(x, y));
  }
  long long int ans = (long long int)s;
  sort(a.begin(), a.end());
  for (int i = 0; i < n; ++i) {
    if (ans > a[i].first) {
      ans += a[i].second;
    } else {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  return 0;
}
