#include <bits/stdc++.h>
using namespace std;
vector<long long int> graph[100001];
long long int visited[100001];
long long int ok = 1;
long long int n, m;
void dfs(long long int start) {
  visited[start] = 1;
  for (auto i : graph[start]) {
    if (!visited[i]) {
      dfs(i);
    }
  }
}
int main() {
  memset(visited, 0, sizeof(visited));
  cin >> n >> m;
  for (long long int i = 0; i < m; i++) {
    long long int u, v;
    cin >> u >> v;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  if (m != n - 1) {
    cout << "no" << endl;
  } else {
    ok = 1;
    dfs(1);
    for (long long int i = 1; i <= n; i++) {
      if (!visited[i]) {
        ok = 0;
      }
    }
    if (!ok) {
      cout << "no" << endl;
    } else {
      cout << "yes" << endl;
    }
  }
  return 0;
}
