#include <bits/stdc++.h>
using namespace std;
vector<int> g[1500];
int clr[1500];
string good = "yes";
void dfs(int l, int a) {
  clr[a] = 1;
  for (int i = 0; i < g[a].size(); i++) {
    int u = g[a][i];
    if (clr[u] == 1 && u != l) {
      good = "no";
      return;
    }
    if (u != l) dfs(a, u);
  }
  clr[a] = 2;
}
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, 1);
  for (int i = 1; i <= n; i++) {
    if (clr[i] == 0) {
      good = "no";
    }
    break;
  }
  cout << good;
  return 0;
}
