#include <bits/stdc++.h>
using namespace std;
const int MAX = 1010;
bool bio[MAX];
bool e[MAX][MAX];
int n;
void dfs(int x) {
  bio[x] = true;
  for (int i = (0); i < (n); ++i)
    if (!bio[i] && e[x][i]) dfs(i);
}
int main(void) {
  int m;
  scanf("%d %d", &n, &m);
  for (int i = (0); i < (m); ++i) {
    int a, b;
    scanf("%d %d", &a, &b);
    --a, --b;
    e[a][b] = e[b][a] = 1;
  }
  dfs(0);
  int ans = 0;
  for (int i = (0); i < (n); ++i) ans += bio[i];
  if (ans == n && m == n - 1)
    puts("yes");
  else
    puts("no");
  return 0;
}
