#include <bits/stdc++.h>
using namespace std;
int main() {
  srand(time(NULL));
  int n, m;
  while (scanf("%d%d", &n, &m) == 2) {
    vector<vector<int> > es = vector<vector<int> >(n);
    for (int i = 0; i < m; i++) {
      int s, t;
      scanf("%d%d", &s, &t);
      --s, --t;
      if (s == t) continue;
      es[s].push_back(t), es[t].push_back(s);
    }
    for (int i = 0; i < n; i++) {
      sort(es[i].begin(), es[i].end());
      es[i].resize(unique(es[i].begin(), es[i].end()) - es[i].begin());
    }
    for (int i = 0; i < n; i++) {
      vector<pair<int, int> > ps(((int)((es[i]).size())));
      for (int j = 0; j < ((int)((es[i]).size())); j++)
        ps[j] = make_pair(((int)((es[es[i][j]]).size())), es[i][j]);
      sort(ps.begin(), ps.end());
      for (int j = 0; j < ((int)((es[i]).size())); j++) es[i][j] = ps[j].second;
    }
    bool found = 0;
    for (int start = 0; start < n; start++) {
      vector<int> used(n, 0);
      bool ok = 1;
      for (int v = start, iter = 0; iter < n - 1; iter++) {
        used[v] = 1;
        ok = 0;
        for (int it = 0; it < ((int)((es[v]).size())); it++) {
          int u = es[v][it];
          if (used[u]) continue;
          v = u;
          ok = 1;
          break;
        }
        if (!ok) break;
      }
      if (ok) {
        found = 1;
        break;
      }
    }
    printf(found ? "Yes\n" : "No\n");
  }
  return 0;
}
