#include <bits/stdc++.h>
using namespace std;
const int MAX = 1010;
int n, m;
vector<int> e[MAX];
bool mark[MAX];
void YES() {
  puts("yes");
  exit(0);
}
void NO() {
  puts("no");
  exit(0);
}
void dfs(int u, int p) {
  mark[u] = false;
  for (auto v : e[u]) {
    if (mark[v])
      dfs(v, u);
    else if (v != p)
      NO();
  }
}
int main() {
  scanf("%d%d", &n, &m);
  if (m != n - 1) NO();
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    x--;
    y--;
    e[x].push_back(y);
    e[y].push_back(x);
  }
  memset(mark, true, sizeof(mark));
  dfs(0, -1);
  int c = 0;
  for (int i = 0; i < n; i++) c += mark[i];
  if (c > 0) NO();
  YES();
}
