#include <bits/stdc++.h>
using namespace std;
vector<long long int> v[1005];
long long int visited[1005] = {0};
void dfs(int x) {
  visited[x] = 1;
  for (int i = 0; i < v[x].size(); i++) {
    if (visited[v[x][i]] == 0) dfs(v[x][i]);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m, i, j, a, b;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  dfs(1);
  for (i = 1; i <= m; i++) {
    if (visited[i] == 0) {
      cout << "no";
      return 0;
    }
  }
  if (m == n - 1)
    cout << "yes";
  else
    cout << "no";
  return 0;
}
