#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T b, T p, T m) {
  T ret;
  if (p == 0) return 1;
  if (p & 1) {
    ret = (bigmod(b, p / 2, m) % m);
    return ((b % m) * ret * ret) % m;
  } else {
    ret = (bigmod(b, p / 2, m) % m);
    return (ret * ret) % m;
  }
}
int dx4[] = {1, -1, 0, 0};
int dy4[] = {0, 0, 1, -1};
int dx6[] = {0, 0, 1, -1, 0, 0};
int dy6[] = {1, -1, 0, 0, 0, 0};
int dz6[] = {0, 0, 0, 0, 1, -1};
int dx8[] = {1, -1, 0, 0, -1, 1, -1, 1};
int dy8[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dkx8[] = {-1, 1, -1, 1, -2, -2, 2, 2};
int dky8[] = {2, 2, -2, -2, 1, -1, 1, -1};
int tc = 1;
const double eps = 1e-9;
const double pi = acos(-1.0);
const long long int mx = 1e3;
const long long int mod = 1e9 + 7;
bool visited[mx + 5];
int edges[mx + 5][mx + 5];
int n, m;
bool flag;
void dfs(int node) {
  int i, k;
  visited[node] = true;
  for (i = 1; i <= n; i++) {
    if (edges[node][i] == 1) {
      if (visited[i]) {
        flag = false;
        return;
      }
      edges[node][i] = -1;
      edges[i][node] = -1;
      dfs(i);
    }
  }
}
int main() {
  int i, a, b;
  scanf("%d %d", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d %d", &a, &b);
    edges[a][b] = 1;
    edges[b][a] = 1;
  }
  flag = true;
  dfs(1);
  for (i = 2; i <= n; i++) {
    if (!visited[i]) {
      flag = false;
      break;
    }
  }
  printf("%s\n", (flag) ? "yes" : "no");
  return 0;
}
