#include <bits/stdc++.h>
using namespace std;
int cnt = 0;
void dfs(int v, vector<int> &used, vector<vector<int> > &g) {
  used[v] = 1;
  cnt++;
  for (int i = 0; i < g[v].size(); i++) {
    int u = g[v][i];
    if (!used[u]) dfs(u, used, g);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  if (m != n - 1) return cout << "no", 0;
  vector<vector<int> > g(n, vector<int>());
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  vector<int> used(n);
  dfs(0, used, g);
  if (cnt == n)
    cout << "yes";
  else
    cout << "no";
}
