#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000 + 100;
vector<int> edge[MAXN];
bool mrk[MAXN];
void dfs(int v) {
  mrk[v] = 1;
  for (int i = 0; i < edge[v].size(); i++)
    if (!mrk[edge[v][i]]) dfs(edge[v][i]);
}
int32_t main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  if (m != n - 1) {
    cout << "no" << endl;
    return 0;
  }
  dfs(0);
  for (int i = 0; i < n; i++)
    if (!mrk[i]) {
      cout << "no" << endl;
      return 0;
    }
  cout << "yes" << endl;
  return 0;
}
