#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
int f[maxn];
void init(int n) {
  for (int i = 1; i <= n; i++) f[i] = i;
}
int find(int x) {
  int r = x, i = x, t;
  while (r != f[r]) r = f[r];
  while (i != r) {
    t = f[i];
    f[i] = r;
    i = t;
  }
  return r;
}
int mix(int x, int y) {
  int fx = find(x), fy = find(y);
  if (fx == fy) return 0;
  f[fx] = fy;
  return 1;
}
int main() {
  int n, m, a, b, ok = 1, sum = 0;
  scanf("%d%d", &n, &m);
  init(n);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a, &b);
    if (ok && !mix(a, b)) ok = 0;
  }
  if (ok)
    for (int i = 1; i <= n; i++)
      if (f[i] == i) sum++;
  if (ok && sum == 1)
    printf("yes\n");
  else
    printf("no\n");
}
