#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
double PI = 3.1415926535897932384626433832795;
double EPS = 1e-2;
const int MAXN = 1000100;
const int MAXC = 1e7;
const int mod = 1e9 + 7;
inline int mul(int a, int b) {
  if (a < 0) a += mod;
  if (b < 0) b += mod;
  return (a * (long long)b) % mod;
}
inline int sum(int a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  return a;
}
inline int sub(int a, int b) {
  a -= b;
  if (a < 0) a += mod;
  return a;
}
inline int pw(int base, int deg) {
  int res = 1;
  while (deg) {
    if (deg & 1) res = mul(base, res);
    base = mul(base, base);
    deg >>= 1;
  }
  return res;
}
int n, m;
vector<vector<int> > gr;
long long ans = 0;
int was[MAXN];
void dfs(int u) {
  was[u] = 1;
  for (int i = 0; i < gr[u].size(); ++i) {
    int to = gr[u][i];
    if (was[to]) continue;
    dfs(to);
  }
}
void solve() {
  cin >> n >> m;
  gr.resize(n + 1);
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    gr[a].push_back(b);
    gr[b].push_back(a);
  }
  dfs(0);
  int k = 0;
  for (int i = 0; i < n; ++i) k += was[i];
  if (n != m + 1 || k != n) {
    cout << "no";
  } else {
    cout << "yes";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  srand(1313);
  int t = 1;
  for (int i = 0; i < t; ++i) {
    solve();
  }
  return 0;
}
