#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<vector<int> > g(N, vector<int>());
vector<int> color(N, 0);
bool cycle = false;
void dfs(int v, int p = -1) {
  color[v] = 1;
  for (auto to : g[v]) {
    if (to == p) {
      continue;
    }
    if (color[to] == 0) {
      dfs(to, v);
    } else if (color[to] == 1) {
      cycle = true;
      return;
    }
  }
  color[v] = 2;
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1);
  if (cycle) {
    cout << "no" << '\n';
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (color[i] != 2) {
      cout << "no" << '\n';
      return 0;
    }
  }
  cout << "yes" << '\n';
  return 0;
}
