#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[3000];
  cin >> n >> m;
  for (int i = 0; i < m * 2; i++) cin >> a[i];
  if (m - n >= 2)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
