#include <bits/stdc++.h>
using namespace std;
const int maxN(1e3 + 10);
int N, M, P[maxN], A[maxN][maxN], C;
void dfs(const int u) {
  C++;
  for (int v = 1; v <= N; v++)
    if (A[u][v] && !P[v]) {
      P[v] = u;
      dfs(v);
    }
}
int main() {
  cin >> N >> M;
  if (M != N - 1) {
    cout << "no";
    return 0;
  }
  for (int i = 0; i < M; i++) {
    int u, v;
    cin >> u >> v;
    A[u][v] = A[v][u] = 1;
  }
  P[1] = -1;
  dfs(1);
  cout << (C == N ? "yes" : "no");
}
