#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
int cnt;
bool visit[1005];
struct node {
  int v;
  node* next;
  node(int k, node* p) : v(k), next(p) {}
} * vnode[1005];
void dfs(int s) {
  visit[s] = true;
  cnt++;
  node* p = vnode[s];
  for (; p; p = p->next) {
    if (!visit[p->v]) dfs(p->v);
  }
  return;
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  node* p = NULL;
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    p = new node(x, vnode[y]);
    vnode[y] = p;
    p = new node(y, vnode[x]);
    vnode[x] = p;
  }
  if (m != (n - 1))
    printf("no\n");
  else {
    memset(visit, false, sizeof(visit));
    cnt = 0;
    dfs(1);
    if (cnt == n)
      printf("yes\n");
    else
      printf("no\n");
  }
  return 0;
}
