#include <bits/stdc++.h>
using namespace std;
long long root[1100], n, m, u, v;
long long findRoot(long long u) {
  if (root[u] < 0) return u;
  return findRoot(root[u]);
}
void join(long long u, long long v) {
  long long tmpU = findRoot(u), tmpV = findRoot(v);
  if (tmpU != tmpV)
    if (root[tmpU] > root[tmpV]) {
      root[tmpV] += root[tmpU];
      root[tmpU] = tmpV;
    } else {
      root[tmpU] += root[tmpV];
      root[tmpV] = tmpU;
    }
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) root[i] = -1;
  for (int i = 1; i <= m; i++) {
    cin >> u >> v;
    join(u, v);
  }
  if (root[findRoot(1)] == -n && m == n - 1)
    cout << "yes";
  else
    cout << "no";
}
