#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 1;
int n, m, k;
vector<int> v[N];
bool was[N];
void dfs(int x) {
  k++;
  was[x] = true;
  for (int y : v[x])
    if (!was[y]) dfs(y);
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  dfs(0);
  if (k == n && m == n - 1)
    cout << "yes" << endl;
  else
    cout << "no" << endl;
  return 0;
}
