#include <bits/stdc++.h>
int par[2309];
int n;
int anc(int p) {
  if (par[p] == p)
    return p;
  else
    return par[p] = anc(par[p]);
}
void join(int p, int q) { par[anc(p)] = anc(q); }
int main() {
  int i, p, q, m;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) par[i] = i;
  scanf("%d", &m);
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &p, &q);
    if (anc(p) != anc(q))
      join(p, q);
    else {
      printf("no");
      return 0;
    }
  }
  int test = anc(1);
  for (int i = 1; i <= n; i++)
    if (anc(i) != test) {
      printf("no");
      return 0;
    }
  printf("yes");
  return 0;
}
