#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ldb = long double;
using pa = pair<ll, ll>;
using vec = vector<ll>;
const ll MOD = 1e9 + 7, N = 1e5 + 10;
const ll LINF = LLONG_MAX;
vector<ll> adj[N];
ll visit[N], n, m;
void dfs(ll v) {
  visit[v] = 1;
  for (auto s : adj[v]) {
    if (!visit[s]) {
      dfs(s);
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  ll i, x, y;
  for (ll i = 0; i < m; i++) {
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  if (n != m + 1) {
    cout << "no\n";
    return 0;
  }
  dfs(1);
  for (ll i = 1; i < n + 1; i++) {
    if (!visit[i]) {
      cout << "no";
      return 0;
    }
  }
  cout << "yes";
  return 0;
}
