#include <bits/stdc++.h>
using namespace std;
int vis[1001];
void dfs(int a[1001][1001], int n, int node) {
  vis[node] = 1;
  for (int j = 0; j < n; j++) {
    if (a[node][j] && !vis[j]) dfs(a, n, j);
  }
}
int main() {
  int n, m;
  int arr[1001][1001];
  for (int i = 0; i < 1001; i++)
    for (int j = 0; j < 1000; j++) arr[i][j] = 0;
  int a, b;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    vis[i] = 0;
  }
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    arr[a - 1][b - 1] = 1;
    arr[b - 1][a - 1] = 1;
  }
  if (n != (m + 1)) {
    cout << "no";
    return 0;
  }
  dfs(arr, n, 0);
  for (int i = 0; i < n; i++) {
    if (vis[i] == 0) {
      cout << "no";
      return 0;
    }
  }
  cout << "yes";
  return 0;
}
