#include <bits/stdc++.h>
using namespace std;
const int N = 1001;
vector<int> g[1001];
bool is[N];
void dfs(int v) {
  is[v] = true;
  for (auto& to : g[v]) {
    if (!is[to]) dfs(to);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  if (n != m + 1) {
    cout << "no";
    return 0;
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(1);
  bool fl = true;
  for (int i = 1; i <= n; i++) fl &= is[i];
  if (n == m + 1 && fl)
    cout << "yes";
  else
    cout << "no";
}
