#include <bits/stdc++.h>
using namespace std;
int n, m;
int num;
vector<int> g[1010];
bool visit[1010];
void DFS(int s) {
  if (visit[s]) return;
  visit[s] = true;
  num++;
  for (int to : g[s]) DFS(to);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  DFS(1);
  if (m == n - 1 && num == n)
    cout << "yes\n";
  else
    cout << "no\n";
  return 0;
}
