#include <bits/stdc++.h>
using namespace std;
vector<int> v[100100];
bool vis[100100];
void go(int s) {
  vis[s] = true;
  for (int i = 0; i < (int)(v[s]).size(); i++) {
    if (!vis[v[s][i]]) go(v[s][i]);
  }
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  if (m + 1 != n) {
    cout << "no" << endl;
    return 0;
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    v[a].push_back(b);
    v[b].push_back(a);
  }
  go(1);
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      cout << "no" << endl;
      return 0;
    }
  }
  cout << "yes" << endl;
  return 0;
}
