#include <bits/stdc++.h>
int n, m;
int head[1005];
int findhead(int x) {
  if (head[x] == x) return x;
  return head[x] = findhead(head[x]);
}
int main() {
  int i, x, y;
  bool ans = false;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) head[i] = i;
  ans = true;
  for (i = 0; i < m; i++) {
    scanf("%d%d", &x, &y);
    if (findhead(x) == findhead(y)) ans = false;
    head[findhead(x)] = findhead(y);
  }
  for (i = 1; i <= n; i++)
    if (findhead(i) != findhead(1)) ans = false;
  if (ans)
    printf("yes");
  else
    printf("no");
}
