#include <bits/stdc++.h>
using namespace std;
vector<int> brains[1001], vis(1001);
int cc = 0;
void dfs(int node) {
  vis[node] = 1;
  for (int brain : brains[node]) {
    if (!vis[brain]) dfs(brain);
  }
}
void solve() {
  int n, m;
  cin >> n >> m;
  int i;
  for (i = 0; 0 < m ? i < m : i > m; 0 < m ? i++ : i--) {
    int a, b;
    cin >> a >> b;
    brains[a].push_back(b);
    brains[b].push_back(a);
  }
  if (m != n - 1) {
    cout << "no\n";
    return;
  }
  for (i = 1; 1 < n + 1 ? i < n + 1 : i > n + 1; 1 < n + 1 ? i++ : i--) {
    if (!vis[i]) dfs(i), cc++;
  }
  cout << (cc == 1 ? "yes\n" : "no\n");
}
int main(void) {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int t = 1;
  while (t--) solve();
  return 0;
}
