#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 100;
int n, a[N], b[N];
void CHECK(int x, int y) {
  for (int i = 0; i < n; i++)
    if (a[i] != x && a[i] != y && b[i] != x && b[i] != y) return;
  cout << "YES\n";
  exit(0);
}
void check(int num) {
  for (int i = 1; i < n; i++)
    if (num == a[i] || num == b[i])
      continue;
    else {
      CHECK(num, a[i]);
      CHECK(num, b[i]);
      return;
    }
  cout << "YES";
  exit(0);
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> n >> n;
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
  check(a[0]);
  check(b[0]);
  cout << "NO";
  return 0;
}
