#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, hold = 0, hold2 = 0;
  cin >> x >> y;
  vector<int> arr1;
  vector<int> arr2;
  for (int i = 0; i < y; i++) {
    int a, b;
    cin >> a;
    arr1.push_back(a);
    cin >> b;
    arr2.push_back(b);
  }
  for (int i = 0; i < y; i++) {
    hold = 0;
    hold2 = 0;
    for (int j = 0; j < y - 1; j++) {
      if (arr1[j] > arr1[j + 1]) {
        hold = arr1[j];
        arr1[j] = arr1[j + 1];
        arr1[j + 1] = hold;
        hold2 = arr2[j];
        arr2[j] = arr2[j + 1];
        arr2[j + 1] = hold2;
      }
    }
  }
  for (int j = 0; j < y; j++) {
    if (x > arr1[j]) {
      x = x + arr2[j];
    } else {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
