#include <bits/stdc++.h>
const int maxn = 1e3 + 10;
std::vector<int> v[maxn];
int vis[maxn];
void dfs(int i = 0, int p = -1) {
  vis[i] = 1;
  for (auto x : v[i])
    if (!vis[x]) dfs(x);
}
int n, m;
bool valid() {
  if (n != m + 1) {
    return false;
  }
  dfs(0);
  int c = 0;
  for (int i = 0; i < maxn; i++) c += vis[i];
  if (c != n) return false;
  return true;
}
int main() {
  std::ios::sync_with_stdio(false);
  int x, y;
  std::cin >> n >> m;
  for (int i = 0; i < m; i++) {
    std::cin >> x >> y;
    --x, --y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  if (valid()) {
    std::cout << "yes\n";
  } else {
    std::cout << "no\n";
  }
  return 0;
}
