#include <bits/stdc++.h>
using namespace std;
using pairs = set<pair<int, int>>;
int m, n;
pairs a;
const string ans[] = {"NO", "YES"};
struct solution : set<int> {
  bool disjoint(solution& s, int u, int v) {
    for (auto x : s)
      if (x == u or x == v) insert(x);
    if (empty()) return true;
    s.swap(*this);
    return false;
  }
  int valid(pairs::iterator it, int z) {
    for (pairs::iterator iu = a.end(); it != iu; ++it) {
      auto [u, v] = *it;
      if (u != z and v != z) {
        if (empty()) {
          insert(u), insert(v);
          continue;
        } else if (solution().disjoint(*this, u, v))
          return 0;
      }
    }
    return 1;
  }
};
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr),
      cin >> n >> m;
  for (int u, v, i = 0; i < m; ++i)
    cin >> u >> v, a.emplace(min(u, v), max(u, v));
  auto it = a.begin();
  auto [u, v] = *it++;
  cout << ans[solution().valid(it, u) or solution().valid(it, v)];
}
