#include <bits/stdc++.h>
using namespace std;
vector<int> node[1005];
bool visited[1005];
int N;
void DFS(int c) {
  visited[c] = 1;
  N--;
  int i, j = node[c].size();
  for (i = 0; i < j; i++) {
    if (!visited[node[c][i]]) DFS(node[c][i]);
  }
}
int main() {
  memset(visited, 0, sizeof(visited));
  int n, m, i, j, a, b;
  scanf("%d %d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d %d", &a, &b);
    node[a - 1].push_back(b - 1);
    node[b - 1].push_back(a - 1);
  }
  if (m != n - 1)
    cout << "no" << endl;
  else {
    N = n;
    DFS(0);
    if (!N)
      cout << "yes" << endl;
    else
      cout << "no" << endl;
  }
}
