#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> g(n + 1);
  bool ok = m == n - 1;
  while (m--) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for (int i = 1; i <= n; ++i) {
    vector<bool> visited(n + 1, false);
    visited[0] = true;
    queue<int> q;
    q.push(i);
    while (!q.empty()) {
      int v = q.front();
      q.pop();
      visited[v] = true;
      for (int u : g[v]) {
        if (!visited[u]) q.push(u);
      }
    }
    bool b = true;
    for (int v : visited) b &= v;
    if (!b) {
      ok = false;
      break;
    }
  }
  if (ok)
    cout << "yes" << endl;
  else
    cout << "no" << endl;
  return 0;
}
