#include <bits/stdc++.h>
using namespace std;
set<int> vertices;
vector<int> graph[1001];
int error = 0;
bool deep(int parent, int pos) {
  if (vertices.count(pos) > 0) {
    return false;
  }
  vertices.insert(pos);
  for (vector<int>::iterator it = graph[pos].begin(); it != graph[pos].end();
       ++it) {
    if (*it != parent) {
      if (!deep(pos, *it)) {
        return false;
      }
    }
  }
  return true;
}
bool validate(int n, int m) {
  int from;
  int to;
  for (int i = 0; i < m; i++) {
    cin >> from;
    cin >> to;
    graph[from].push_back(to);
    graph[to].push_back(from);
  }
  if (graph[1].size() == 0) {
    return false;
  }
  vertices.insert(1);
  for (vector<int>::iterator it = graph[1].begin(); it != graph[1].end();
       ++it) {
    if (!deep(1, *it)) {
      return false;
    }
  }
  if (vertices.size() != n) {
    return false;
  }
  return true;
}
int main(int argc, char** argv) {
  int n, m;
  cin >> n;
  cin >> m;
  if (validate(n, m))
    cout << "yes";
  else
    cout << "no";
  return 0;
}
