#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, m, n, arr[10000], brr[10000], i, len1, len2;
  cin >> s >> n;
  for (m = 0; m < n; m++) {
    cin >> arr[m] >> brr[m];
  }
  for (i = 0; i < n - 1; i++) {
    for (m = 0; m < n - 1; m++) {
      if (arr[m] > arr[m + 1]) {
        len1 = arr[m];
        arr[m] = arr[m + 1];
        arr[m + 1] = len1;
        len2 = brr[m];
        brr[m] = brr[m + 1];
        brr[m + 1] = len2;
      }
    }
  }
  for (m = 0; m < n; m++) {
    if (s > arr[m]) {
      s = s + brr[m];
    } else {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
