#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e3 + 33;
vector<int> a[MAXN];
bool visited[MAXN];
bool ans = true;
int n, m;
void dfs(int i, int prev) {
  visited[i] = true;
  for (int k = 0; k < a[i].size(); k++) {
    int t = a[i][k];
    if (t != prev && visited[t])
      ans = false;
    else if (!visited[t])
      dfs(t, i);
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  int cntr = 0;
  for (int i = 0; i < n; i++)
    if (!visited[i]) dfs(i, -1), cntr++;
  if (!ans || cntr > 1)
    cout << "no";
  else
    cout << "yes";
}
