#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > g;
int used[10000];
int ans = 0;
void dfs(int x) {
  used[x] = 1;
  for (int to : g[x])
    if (!used[to]) dfs(to);
  ans++;
}
int main() {
  ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  if (m != n - 1) {
    cout << "no";
    return 0;
  }
  g.resize(n);
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(0);
  if (ans != n)
    cout << "no";
  else
    cout << "yes";
  return 0;
}
