#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000001;
const int MOD = 1000000007;
const int N = 100009;
vector<int> g[N + 1];
int z[N + 1];
void dfs(int v) {
  if (z[v]) return;
  z[v] = true;
  for (int i = (0); i <= ((int)((g[v]).size()) - 1); ++i) dfs(g[v][i]);
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = (1); i <= (m); ++i) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1);
  for (int i = (1); i <= (n); ++i)
    if (!z[i] || m != n - 1) {
      cout << "no" << endl;
      return 0;
    }
  cout << "yes" << endl;
}
