#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
vector<int> vec[maxn];
bool check[maxn];
void dfs(int cur) {
  check[cur] = 1;
  for (int i = 0; i < (int)vec[cur].size(); i++) {
    int nei = vec[cur][i];
    if (!check[nei]) dfs(nei);
  }
}
int main() {
  int n, m, f, g;
  cin >> n >> m;
  bool khar = 0;
  if (m != n - 1) khar = 1;
  for (int i = 0; i < m; i++) {
    cin >> f >> g;
    vec[f].push_back(g);
    vec[g].push_back(f);
  }
  dfs(1);
  for (int i = 1; i <= n; i++)
    if (!check[i]) khar = 1;
  if (khar)
    cout << "no";
  else
    cout << "yes";
}
