#include <bits/stdc++.h>
using namespace std;
void merge(int arr1[], int arr2[], int l, int r, int m) {
  int i, j, k;
  int n1 = m - l + 1;
  int n2 = r - m;
  int left1[n1], right1[n2];
  int left2[n1], right2[n2];
  for (int i = 0; i < n1; i++) {
    left1[i] = arr1[l + i];
    left2[i] = arr2[l + i];
  }
  for (int j = 0; j < n2; j++) {
    right1[j] = arr1[m + 1 + j];
    right2[j] = arr2[m + 1 + j];
  }
  i = 0;
  j = 0;
  k = l;
  while (i < n1 && j < n2) {
    if (left1[i] <= right1[j]) {
      arr1[k] = left1[i];
      arr2[k] = left2[i];
      i++;
    } else {
      arr1[k] = right1[j];
      arr2[k] = right2[j];
      j++;
    }
    k++;
  }
  while (i < n1) {
    arr1[k] = left1[i];
    arr2[k] = left2[i];
    i++;
    k++;
  }
  while (j < n2) {
    arr1[k] = right1[j];
    arr2[k] = right2[j];
    j++;
    k++;
  }
}
void mergeSort(int arr1[], int arr2[], int l, int r) {
  if (l < r) {
    int m = (l + r) / 2;
    mergeSort(arr1, arr2, l, m);
    mergeSort(arr1, arr2, m + 1, r);
    merge(arr1, arr2, l, r, m);
  }
}
int main() {
  int strength, numDragons;
  cin >> strength >> numDragons;
  int dragons[numDragons];
  int bonus[numDragons];
  for (int i = 0; i < numDragons; ++i) {
    cin >> dragons[i] >> bonus[i];
  }
  mergeSort(dragons, bonus, 0, numDragons - 1);
  int pos = 0;
  for (int i = 0; i < numDragons; i++) {
    if (strength > dragons[i]) {
      strength += bonus[i];
    } else {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
