#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1100;
long long n, m;
vector<long long> adj[MAXN];
bool mark[MAXN];
void dfs(long long v) {
  mark[v] = true;
  for (auto x : adj[v])
    if (!mark[x]) dfs(x);
}
int main() {
  cin >> n >> m;
  if (m != n - 1) return cout << "no", 0;
  for (long long i = 0; i < m; i++) {
    long long u, v;
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v), adj[v].push_back(u);
  }
  dfs(0);
  for (long long i = 0; i < n; i++)
    if (!mark[i]) return cout << "no", 0;
  cout << "yes";
}
