#include <bits/stdc++.h>
using namespace std;
const int N = 2e5, MOD = 1e9 + 7, INF = 1e9;
bool vis[N];
vector<int> g[N];
void dfs(int v) {
  vis[v] = true;
  for (auto u : g[v])
    if (!vis[u]) dfs(u);
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  if (m > n - 1) {
    cout << "no\n";
    return 0;
  }
  dfs(0);
  for (int i = 0; i < n; i++)
    if (!vis[i]) {
      cout << "no\n";
      return 0;
    }
  cout << "yes\n";
  return 0;
}
