#include <bits/stdc++.h>
const int INF = 200000000;
using namespace std;
vector<vector<int> > g;
bool used[1005];
void DFS(int);
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  g.resize(n + 1);
  for (int k = 1; k <= m; k++) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  if (m != n - 1) {
    cout << "no";
    return 0;
  }
  DFS(1);
  for (int k = 1; k <= n; k++)
    if (!used[k]) {
      cout << "no";
      return 0;
    }
  cout << "yes";
  return 0;
}
void DFS(int v) {
  used[v] = true;
  for (int k = 0; k < g[v].size(); k++) {
    int to = g[v][k];
    if (!used[to]) DFS(to);
  }
}
