#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:67108864")
const int MOD = 786433;
const int INF = 1000000001;
const int MAXN = 400;
const long double EPS = 1e-11;
const int HASH_POW = 29;
const long double PI = acos(-1.0);
using namespace std;
double workTime() { return double(clock()) / CLOCKS_PER_SEC; }
void my_return(int code) { exit(code); }
int n, m;
vector<int> G[1010];
bool used[1010];
void dfs(int v) {
  used[v] = true;
  for (int i = 0; i < G[v].size(); ++i) {
    int to = G[v][i];
    if (!used[to]) dfs(to);
  }
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  mt19937 mt_rand(time(0));
  scanf("%d %d", &n, &m);
  if (m != n - 1) {
    printf("no\n");
    my_return(0);
  }
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs(1);
  bool good = true;
  for (int i = 1; i <= n; ++i)
    if (!used[i]) good = false;
  if (good)
    printf("yes\n");
  else
    printf("no\n");
  my_return(0);
}
