#include <bits/stdc++.h>
using namespace std;
int n, m;
bool vis[1000];
vector<vector<int> > al;
bool dfs(int i, int p) {
  if (vis[i]) return 0;
  vis[i] = 1;
  for (int j : al[i])
    if (j != p) {
      if (!dfs(j, i)) return 0;
    }
  return 1;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m;
  al.resize(n);
  for (int c = 0; c < m; c++) {
    int i, j;
    cin >> i >> j;
    i--;
    j--;
    al[i].push_back(j);
    al[j].push_back(i);
  }
  if (dfs(0, -1) && accumulate(vis, vis + n, 0) == n) {
    cout << "yes\n";
    return 0;
  }
  cout << "no\n";
}
