#include <bits/stdc++.h>
using namespace std;
int fa[1111];
int ff(int k) {
  if (k == fa[k]) return k;
  return fa[k] = ff(fa[k]);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  if (m != n - 1) {
    printf("no\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) fa[i] = i;
  for (int i = 1; i <= m; i++) {
    int k, l;
    scanf("%d%d", &k, &l);
    int o = ff(k), p = ff(l);
    if (o != p)
      fa[o] = p;
    else {
      printf("no\n");
      return 0;
    }
  }
  printf("yes\n");
  return 0;
}
