#include <bits/stdc++.h>
using namespace std;
int n, m, fa[1100];
int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }
int main() {
  scanf("%d%d", &n, &m);
  if (m != n - 1) return puts("no"), 0;
  for (int i = 1; i <= n; i++) fa[i] = i;
  for (int i = 1, x, y; i <= m; i++) {
    scanf("%d%d", &x, &y);
    fa[find(x)] = find(y);
  }
  for (int i = 1; i <= n; i++)
    if (find(i) != find(1)) return puts("no"), 0;
  puts("yes");
}
