#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
int m, n, vis[maxn];
int du[maxn];
vector<int> g[maxn];
int f;
void init() {
  for (int i = 1; i <= n; i++) {
    g[i].clear();
    vis[i] = 0;
    du[i] = 0;
  }
}
void dfs(int u) {
  vis[u] = 1;
  if (du[u] == 1) f = 1;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (!vis[v]) {
      dfs(v);
    }
  }
}
int main() {
  while (~scanf("%d%d", &n, &m)) {
    int cnt = 0;
    int a, b;
    init();
    for (int i = 0; i < m; i++) {
      scanf("%d%d", &a, &b);
      du[a]++, du[b]++;
      g[a].push_back(b);
      g[b].push_back(a);
    }
    int T = 0;
    if (m != n - 1)
      printf("no\n");
    else {
      for (int i = 1; i <= n; i++) {
        if (!vis[i]) {
          T++;
          f = 0;
          dfs(i);
          if (!f) cnt++;
        }
      }
      if (!cnt) {
        if (T == 1)
          printf("yes\n");
        else
          printf("no\n");
      } else
        printf("no\n");
    }
  }
  return 0;
}
