#include <bits/stdc++.h>
using namespace std;
int father[2003];
int ff(int x) {
  if (father[x] == x)
    return x;
  else
    return father[x] = ff(father[x]);
}
int main() {
  int n, t;
  while (scanf("%d %d", &n, &t) != EOF) {
    for (int i = 1; i <= n; i++) father[i] = i;
    bool flag = true;
    while (t--) {
      int a, b;
      scanf("%d %d", &a, &b);
      if (!flag) continue;
      int fa = ff(a), fb = ff(b);
      if (fa != fb)
        father[fa] = father[fb];
      else
        flag = false;
    }
    if (!flag) {
      printf("no\n");
      continue;
    }
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
      if (father[i] == i) cnt++;
    }
    if (cnt == 1)
      printf("yes\n");
    else
      printf("no\n");
  }
  return 0;
}
