#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > graf(1001);
struct muc {
  int rank, parinte;
} nod[1001];
int find(int x) {
  if (nod[x].parinte != x) nod[x].parinte = find(nod[x].parinte);
  return nod[x].parinte;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  if (m + 1 != n) {
    printf("no");
    return 0;
  }
  for (int i = 1; i <= n; ++i) nod[i].parinte = i, nod[i].rank = 0;
  int da, nu;
  while (m--) {
    scanf("%d%d", &da, &nu);
    int xroot = find(da);
    int yroot = find(nu);
    if (xroot == yroot) {
      printf("no");
      return 0;
    }
    if (nod[xroot].rank > nod[yroot].rank)
      nod[yroot].parinte = xroot;
    else if (nod[xroot].rank < nod[yroot].rank)
      nod[xroot].parinte = yroot;
    else
      nod[yroot].parinte = xroot, nod[xroot].rank++;
  }
  printf("yes");
  return 0;
}
