#include <bits/stdc++.h>
using namespace std;
int V, E;
vector<vector<pair<int, int> > > G;
vector<bool> br;
vector<int> d, low;
bool Bridges;
int timer;
void dfs(int x, int p = 0) {
  d[x] = low[x] = ++timer;
  for (auto& t : G[x]) {
    if (d[t.first] == 0) {
      dfs(t.first, x);
      if (low[t.first] > d[x]) {
        br[t.second] = 1;
      }
      low[x] = min(low[x], low[t.first]);
    } else if (d[t.first] < d[x] and t.first != p) {
      low[x] = min(low[x], d[t.first]);
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> V >> E;
  G.resize(V + 1);
  int i, u, v;
  for (i = 1; i <= E; i++) {
    cin >> u >> v;
    G[u].push_back({v, i});
    G[v].push_back({u, i});
  }
  timer = 0;
  d.resize(V + 1, 0);
  low.resize(V + 1, 0);
  br.resize(E + 1, 0);
  dfs(1);
  bool fl = 1;
  for (i = 1; i <= E; i++)
    if (!br[i]) {
      fl = 0;
      break;
    }
  if (fl)
    for (i = 1; i <= V; i++)
      if (d[i] == 0) {
        fl = 0;
        break;
      }
  cout << (fl ? "yes" : "no") << endl;
  return 0;
};
