#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, n, count = 0;
  cin >> s >> n;
  int arr[n][2];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 2; j++) cin >> arr[i][j];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (s <= arr[j][0]) continue;
      if (s > arr[j][0] && arr[j][0] != -1 && arr[j][1] != -1) {
        s = s + arr[j][1];
        count += 1;
        arr[j][0] = -1;
        arr[j][1] = -1;
      }
    }
  }
  if (count == n)
    cout << "YES";
  else
    cout << "NO";
}
