#include <bits/stdc++.h>
int n, m;
int bcj[(1000 + 10)];
int fa(int a) {
  int c = a, k;
  while (bcj[a] != a) a = bcj[a];
  while (c != a) {
    k = bcj[c];
    bcj[c] = a;
    c = k;
  }
  return a;
}
void build(int a, int b) {
  int Fa = fa(a), Fb = fa(b);
  if (Fa != Fb) bcj[Fa] = Fb;
}
void In() {
  scanf("%d%d", &n, &m);
  if (m != n - 1) {
    printf("no");
    exit(0);
  }
  int a, b;
  for (int i = 1; i <= n; ++i) bcj[i] = i;
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &a, &b);
    build(a, b);
  }
}
void solve() {
  for (int i = 1; i <= n; ++i) bcj[i] = fa(i);
  for (int i = 2; i <= n; ++i)
    if (bcj[i] != bcj[1]) {
      printf("no");
      exit(0);
    }
  printf("yes");
}
int main() {
  In();
  solve();
  return 0;
}
