#include <bits/stdc++.h>
using namespace std;
class Unionfind {
 public:
  bool can;
  int parent[1005], rank[1005], cco;
  Unionfind(int n) {
    for (int i = 1; i < n + 1; ++i) {
      rank[i] = 1;
      parent[i] = i;
    }
    can = true;
    cco = n;
  }
  int find(int u) {
    if (parent[u] == u)
      return u;
    else
      return parent[u] = find(parent[u]);
  }
  void join(int i, int j) {
    if (find(i) == find(j)) {
      can = false;
      return;
    }
    i = find(i);
    j = find(j);
    if (rank[i] < rank[j]) swap(i, j);
    parent[j] = i;
    cco--;
    if (rank[i] == rank[j]) rank[i]++;
  }
};
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  Unionfind uf(n);
  while (m--) {
    int a, b;
    scanf("%d %d", &a, &b);
    uf.join(a, b);
  }
  printf((uf.can && uf.cco == 1) ? "yes\n" : "no\n");
  return 0;
}
