#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int MOD = 1e9 + 7, MAX = 1e6 + 5;
const long long INF = 1e18 + 5;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > P(m);
  vector<int> P1, P2;
  for (int i = 0; i < m; i++) {
    cin >> P[i].first >> P[i].second;
  }
  P1 = {P[0].first, P[0].second};
  P2 = P1;
  for (int i = 1; i < m; i++) {
    if (P[i].first != P1[0] && P[i].first != P1[1] && P[i].second != P1[0] &&
        P[i].second != P1[1]) {
      P2 = {P[i].first, P[i].second};
      break;
    }
  }
  bool maincan = false;
  for (auto p1 : P1) {
    for (auto p2 : P2) {
      bool can = true;
      for (int i = 0; i < m; i++) {
        if (P[i].first != p1 && P[i].first != p2 && P[i].second != p1 &&
            P[i].second != p2) {
          can = false;
          break;
        }
      }
      if (can) maincan = true;
    }
  }
  if (maincan)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
