#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
vector<int> v[maxn];
bool mark[maxn];
int ans = 0;
int dfs(int a) {
  mark[a] = 1;
  ans++;
  for (int i = 0; i < v[a].size(); i++)
    if (!mark[v[a][i]]) dfs(v[a][i]);
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  if (m != n - 1)
    cout << "no" << endl;
  else {
    dfs(1);
    if (ans == n)
      cout << "yes" << endl;
    else
      cout << "no" << endl;
  }
}
