#include <bits/stdc++.h>
const int maxn = 10007;
int n, m, c;
struct edge {
  int v;
  edge *n;
} ep[maxn * 2], *el[maxn];
int epl;
bool vis[maxn];
void addEdge(int u, int v) {
  el[u] = &(ep[epl++] = {v, el[u]});
  el[v] = &(ep[epl++] = {u, el[v]});
}
bool dfs(int u, int f) {
  if (vis[u]) return false;
  ++c;
  vis[u] = true;
  for (edge *e = el[u]; e; e = e->n)
    if (e->v != f && !dfs(e->v, u)) return false;
  return true;
}
int main() {
  scanf("%d%d", &n, &m);
  if (n - 1 != m) {
    puts("no");
    return 0;
  }
  for (int i = 1, u, v; i < n; ++i) {
    scanf("%d%d", &u, &v);
    addEdge(u, v);
  }
  if (dfs(1, 0) && c == n)
    puts("yes");
  else
    puts("no");
  return 0;
}
