#include <bits/stdc++.h>
const long long int sz = 1e5 + 5;
using namespace std;
bool vis[1005] = {false};
vector<long long int> adj[1005];
bool recstack[1005] = {false};
long long int cycle = 0;
long long int level[1005] = {0};
void dfs(long long int node) {
  vis[node] = true;
  recstack[node] = true;
  for (auto it : adj[node]) {
    if (!vis[it]) {
      level[it] = level[node] + 1;
      dfs(it);
    } else if (recstack[it] && (level[node] - level[it]) > 1)
      cycle++;
  }
  recstack[node] = false;
}
int main() {
  long long int n, m;
  cin >> n >> m;
  for (long long int i = 1; i <= m; i++) {
    long long int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  long long int connected = 0;
  for (long long int i = 1; i <= n; i++) {
    if (!vis[i]) {
      dfs(i);
      connected++;
    }
  }
  if (connected == 1 && cycle == 0) {
    cout << "yes\n";
  } else
    cout << "no\n";
}
