#include <bits/stdc++.h>
using namespace std;
vector<int> ke[100005];
vector<pair<int, int> > khop;
bool cutcau[100005];
int low[100005], num[100005], parent[100005], n, m, cnt_children, cnt, root,
    dem;
void dfs(int u) {
  num[u] = low[u] = ++cnt;
  for (int i = (0); i <= ((int)ke[u].size() - 1); ++i) {
    int v = ke[u][i];
    if (num[v] == 0) {
      parent[v] = u;
      if (u == root) ++cnt_children;
      dfs(v);
      if (low[v] >= num[u]) cutcau[u] = true;
      low[u] = min(low[u], low[v]);
    } else if (parent[u] != v)
      low[u] = min(low[u], num[v]);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = (1); i <= (m); ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    ke[u].push_back(v);
    ke[v].push_back(u);
  }
  for (int u = (1); u <= (n); ++u) {
    if (num[u] == 0) {
      root = u;
      cnt_children = 0;
      dfs(u);
      cutcau[u] = (cnt_children > 1);
    }
  }
  for (int i = (1); i <= (n); ++i) {
    if (cutcau[i]) ++dem;
  }
  for (int i = (1); i <= (n); ++i)
    if (ke[i].size() == 1) ++dem;
  if (dem == n)
    printf("yes");
  else
    printf("no");
  return 0;
}
