#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> Adjl[1007];
bool reached[1007];
bool circle;
bool connected;
void dfs(int s);
int main() {
  cin >> n >> m;
  circle = false;
  connected = true;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    Adjl[a].push_back(b);
    Adjl[b].push_back(a);
  }
  reached[1] = true;
  dfs(1);
  for (int i = 1; i <= n; i++) {
    if (!reached[i]) {
      connected = false;
    }
  }
  if (m == n - 1) {
    circle = false;
  } else {
    circle = true;
  }
  if (!connected || circle) {
    cout << "no" << endl;
  } else {
    cout << "yes" << endl;
  }
  return 0;
}
void dfs(int s) {
  for (int i = 0; i < Adjl[s].size(); i++) {
    int t = Adjl[s][i];
    if (reached[t]) {
      circle = true;
    } else {
      reached[t] = true;
      dfs(t);
    }
  }
}
