#include <bits/stdc++.h>
using namespace std;
int n, m, used[10001];
vector<int> g[10001];
bool trap;
void DFS(int u, int pa) {
  used[u] = 1;
  for (auto i : g[u]) {
    if (i == pa) continue;
    if (used[i] == 1) trap = true;
    if (used[i] == 0) {
      DFS(i, u);
    }
  }
}
int main() {
  cin >> n >> m;
  int u, v;
  for (int i = 1; i <= m; i++) {
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  if (n <= m)
    cout << "no";
  else {
    DFS(1, -1);
    for (int i = 1; i <= n; i++) {
      if (used[i] == 0) trap = true;
    }
    if (trap)
      cout << "no";
    else
      cout << "yes";
  }
}
