#include <bits/stdc++.h>
using namespace std;
vector<int> e[100500];
bool visited[100500];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  if (m != n - 1) {
    cout << "no" << endl;
    return 0;
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    u--;
    v--;
    e[u].push_back(v);
    e[v].push_back(u);
  }
  visited[0] = true;
  list<int> sp;
  sp.push_back(0);
  while (sp.begin() != sp.end()) {
    int u = sp.front();
    sp.pop_front();
    for (int i = 0; i < e[u].size(); i++) {
      int v = e[u][i];
      if (!visited[v]) sp.push_back(v);
      visited[v] = true;
    }
  }
  for (int i = 0; i < n; i++)
    if (!visited[i]) {
      cout << "no" << endl;
      return 0;
    }
  cout << "yes" << endl;
  return 0;
}
