#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
const int MAX = 3e5 + 5;
int arra[MAX];
int arrb[MAX];
int main() {
  int n, m;
  cin >> n >> m;
  int a1, b1;
  cin >> a1 >> b1;
  map<int, int> mpa;
  map<int, int> mpb;
  int a, b;
  int tota = 1;
  int totb = 1;
  for (int i = 1; i < m; ++i) {
    cin >> a >> b;
    if (a == a1 || b == a1) tota++;
    if (a == b1 || b == b1) totb++;
    if (a != a1 && b != a1) mpa[a]++, mpa[b]++;
    if (a != b1 && b != b1) mpb[a]++, mpb[b]++;
  }
  bool flag = false;
  for (auto i : mpa) {
    if (i.second + tota >= m) {
      flag = true;
      break;
    }
  }
  for (auto i : mpb) {
    if (i.second + totb >= m) {
      flag = true;
      break;
    }
  }
  if (tota >= m || totb >= m) flag = true;
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
