#include <bits/stdc++.h>
using namespace std;
vector<long long> G[10000];
long long n, m;
bool visited[10000];
long long ans;
void dfs(int u, int v) {
  visited[u] = true;
  ans++;
  for (int i : G[u]) {
    if (!visited[i]) dfs(i, u);
  }
}
int main() {
  int x, y;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    G[x].push_back(y);
    G[y].push_back(x);
  }
  if (m >= n) {
    cout << "no";
    return 0;
  }
  dfs(1, 0);
  if (ans < n)
    cout << "no";
  else
    cout << "yes";
  return 0;
}
