#include <bits/stdc++.h>
int n, m, i, a[1001][1001] = {0}, u, v, l, s, b[1001], vis[1001] = {0}, e, c;
int main() {
  scanf("%d %d", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d %d", &u, &v);
    a[u][v] = 1;
    a[v][u] = 1;
  }
  if (m == n - 1) {
    l = 1;
    s = 1;
    b[l] = 1;
    vis[1] = 1;
    e = 0;
    while (e == 0) {
      c = b[l];
      l++;
      for (i = 1; i <= n; i++)
        if (a[c][i] > 0 && vis[i] == 0) {
          s++;
          b[s] = i;
          vis[i] = 1;
        }
      if (l == s + 1) e = 1;
    }
    for (i = 1; i <= n; i++)
      if (vis[i] == 0) {
        printf("no");
        return 0;
      }
    printf("yes");
  } else
    printf("no");
  return 0;
}
