#include <bits/stdc++.h>
using namespace std;
vector<int> G[1005];
bool vst[1005];
void dfs(int s) {
  vst[s] = true;
  for (int i = 0; i < G[s].size(); i++) {
    int u = G[s][i];
    if (vst[u]) continue;
    dfs(u);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  if (m != n - 1) {
    cout << "no\n";
    return 0;
  }
  while (m-- > 0) {
    int a, b;
    cin >> a >> b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  dfs(1);
  for (int i = 1; i <= n; i++) {
    if (!vst[i]) {
      cout << "no\n";
      return 0;
    }
  }
  cout << "yes\n";
  return 0;
}
