#include <bits/stdc++.h>
using namespace std;
bool visited[1001];
vector<int> v[1001];
queue<int> q;
void yes(void) { cout << "yes" << endl; }
void no(void) { cout << "no" << endl; }
int main() {
  memset(visited, false, sizeof visited);
  int n, m, a, b;
  cin >> n >> m;
  set<int> s;
  cin >> a >> b;
  q.push(a);
  s.insert(a);
  v[a].push_back(b);
  v[b].push_back(a);
  for (int i = 0; i < m - 1; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  while (!q.empty()) {
    int u = q.front();
    if (!visited[u]) {
      for (int i = 0; i < v[u].size(); i++) {
        q.push(v[u][i]);
        s.insert(v[u][i]);
      }
    }
    visited[u] = true;
    q.pop();
  }
  if (n - m == 1 and s.size() == n)
    yes();
  else
    no();
  return 0;
}
