#include <bits/stdc++.h>
using namespace std;
int ans;
int father[1100];
int find(int x) {
  if (father[x] == x) return x;
  father[x] = find(father[x]);
  return father[x];
}
bool Union(int x, int y) {
  int f1 = find(x);
  int f2 = find(y);
  if (f1 == f2) return false;
  if (f1 < f2)
    father[f1] = f2;
  else
    father[f2] = f1;
  ans++;
  return true;
}
int n, m;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) father[i] = i;
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    if (!Union(x, y)) {
      cout << "no" << endl;
      return 0;
    }
  }
  if (m != n - 1)
    cout << "no" << endl;
  else
    cout << "yes" << endl;
  return 0;
}
