#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<vector<int>> g(n + 1, vector<int>());
  for (int i = 0; i < n; ++i) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  if (m != n - 1) {
    cout << "no" << endl;
    return 0;
  }
  vector<int> seen(n + 1, 0);
  seen[1] = 1;
  int seen_count = 1;
  queue<int> q;
  q.push(1);
  while (!q.empty()) {
    int next = q.front();
    q.pop();
    for (int i = 0; i < g[next].size(); ++i) {
      int adj = g[next][i];
      if (seen[adj] == 1) {
        continue;
      }
      seen[adj] = 1;
      ++seen_count;
      q.push(adj);
    }
  }
  if (seen_count == n) {
    cout << "yes";
  } else {
    cout << "no";
  }
  cout << endl;
  return 0;
}
