#include <bits/stdc++.h>
using namespace std;
vector<vector<long long> > a;
bool v[1001];
bool flag;
long long visit, n, m;
void add(long long x, long long y) {
  a[x][0]++;
  a[y][0]++;
  a[x].push_back(y);
  a[y].push_back(x);
}
void bfs(long long p, long long pp) {
  long long i;
  if (v[p]) {
    cout << "no";
    exit(0);
  }
  visit++;
  v[p] = 1;
  for (i = 1; i <= a[p][0]; i++)
    if (a[p][i] != pp) bfs(a[p][i], p);
  if (visit == n) {
    cout << "yes";
    exit(0);
  }
}
int main() {
  long long i, x, y;
  vector<long long> q;
  q.push_back(0);
  for (i = 0; i < 1001; i++) a.push_back(q);
  cin >> n >> m;
  if (n - 1 != m) {
    cout << "no";
    return 0;
  }
  for (i = 0; i < m; i++) {
    cin >> x >> y;
    add(x, y);
  }
  bfs(1, 0);
  return 0;
}
