#include <bits/stdc++.h>
const int p = 259;
using namespace std;
vector<int> g[10000];
vector<char> used;
void dfs(int v) {
  used[v] = true;
  for (vector<int>::iterator i = g[v].begin(); i != g[v].end(); ++i)
    if (!used[*i]) dfs(*i);
}
int main() {
  int n, m;
  cin >> n >> m;
  if (n != (m + 1)) {
    cout << "no";
    return 0;
  }
  used.resize(n);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(0);
  for (int i = 0; i < n; i++) {
    if (used[i] == 0) {
      cout << "no";
      return 0;
    }
  }
  cout << "yes";
  return 0;
}
