#include <bits/stdc++.h>
using namespace std;
struct node {
  int from;
  vector<int> adj;
};
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> dis(n + 1, 0);
  vector<node> edge(n + 1);
  while (m--) {
    int a, b;
    cin >> a >> b;
    edge[a].adj.push_back(b);
    edge[b].adj.push_back(a);
  }
  queue<int> q;
  for (int i = 1; i <= n; ++i) edge[i].from = 0;
  dis[1] = 1;
  q.push(1);
  bool flag = 1;
  while (!q.empty() && flag) {
    int u = q.front();
    q.pop();
    for (int i = 0; i < edge[u].adj.size(); ++i) {
      if (edge[u].adj[i] == edge[u].from) continue;
      if (dis[edge[u].adj[i]] != 1) {
        dis[edge[u].adj[i]] = 1;
        edge[edge[u].adj[i]].from = u;
        q.push(edge[u].adj[i]);
      } else {
        flag = 0;
        break;
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (dis[i] != 1) {
      flag = 0;
      break;
    }
  }
  cout << (flag ? "yes" : "no") << endl;
  return 0;
}
