#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
bool vis[N];
vector<int> v[N];
int cnt;
void dfs(int i) {
  vis[i] = true;
  cnt++;
  for (auto it : v[i])
    if (!vis[it]) dfs(it);
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  if (n - m != 1) {
    cout << "no\n";
    return 0;
  }
  dfs(1);
  if (cnt != n) {
    cout << "no\n";
    return 0;
  }
  cout << "yes\n";
}
