#include <bits/stdc++.h>
using namespace std;
short int visit[100000];
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  long long n, v, x, y, sum = 0;
  cin >> n >> v;
  vector<long long> g[n + 1];
  for (int i = 1; i <= v; i++) {
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  if (v != (n - 1)) {
    cout << "no" << endl;
    return 0;
  }
  queue<long long> q;
  long long a = 1;
  q.push(a);
  while (!q.empty()) {
    long long d = q.front();
    long long t = g[d].size();
    q.pop();
    visit[a] = 1;
    for (int i = 0; i < t; i++) {
      if (visit[g[d][i]] == 0) {
        q.push(g[d][i]);
        sum++;
        visit[g[d][i]] = 1;
      }
    }
  }
  sum == (n - 1) ? cout << "yes" << endl : cout << "no" << endl;
  return 0;
}
