#include <bits/stdc++.h>
using namespace std;
int find(int u[], int i) {
  if (u[i] == i) {
    return i;
  }
  return (u[i] = find(u, u[i]));
}
int main() {
  int n, m;
  cin >> n >> m;
  if (n != m + 1) {
    cout << "no" << endl;
    return 0;
  }
  int ufs[n];
  for (int i = 0; i < n; i++) {
    ufs[i] = i;
  }
  int a, b;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    int c = find(ufs, a - 1);
    int d = find(ufs, b - 1);
    if (c == d) {
      cout << "no" << endl;
      return 0;
    }
    int m = min(c, d);
    ufs[c] = m;
    ufs[d] = m;
  }
  for (int i = 0; i < n; i++) {
    if (find(ufs, i) != 0) {
      cout << "no" << endl;
      return 0;
    }
  }
  cout << "yes" << endl;
}
