#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7, mod1 = 1e9 + 9;
const long long N = 1000005;
vector<long long> ed[N];
long long ans = 0;
int vis[N];
void dfs(int in, int par) {
  ans++;
  vis[in] = 1;
  for (auto x : ed[in])
    if (x != par && vis[x] == 0) dfs(x, in);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int n, m;
  cin >> n >> m;
  if (m != n - 1) {
    cout << "no";
    return 0;
  }
  for (long long i = 0; i < (m); i++) {
    int x, y;
    cin >> x >> y;
    ed[x].push_back(y), ed[y].push_back(x);
  }
  dfs(1, 0);
  if (ans == n)
    cout << "yes";
  else
    cout << "no";
  return 0;
}
