#include <bits/stdc++.h>
using namespace std;
void dfs(int a, int p, vector<vector<int>>& adj, int& u) {
  if (u > adj.size()) {
    return;
  }
  for (auto c : adj[a]) {
    if (c != p) {
      ++u;
      dfs(c, a, adj, u);
    }
  }
}
int main() {
  int n, e;
  cin >> n >> e;
  int tmp = 1;
  vector<vector<int>> adj(n);
  for (int i{}; i < e; ++i) {
    int x, y;
    cin >> x >> y;
    adj[x - 1].push_back(y - 1);
    adj[y - 1].push_back(x - 1);
  }
  int u = 1;
  dfs(0, -1, adj, u);
  if (u == n)
    cout << "yes";
  else
    cout << "no";
}
