#include <bits/stdc++.h>
using namespace std;
int fa[1005];
int find(int x) { return x == fa[x] ? x : fa[x] = find(fa[x]); }
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  if (m != n - 1) return puts("no"), 0;
  for (int i = 1; i <= n; i++) fa[i] = i;
  int u, v;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &u, &v);
    if (find(u) == find(v)) return puts("no"), 0;
    fa[find(v)] = find(u);
  }
  puts("yes");
  return 0;
}
