#include <bits/stdc++.h>
using namespace std;
int N, M, A[300005], B[300005], x, y, ans = false, did = false;
vector<pair<int, int> > V;
bool chk[300005];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> M;
  for (int i = 1; i <= M; i++) {
    cin >> A[i] >> B[i];
    if (A[i] > B[i]) swap(A[i], B[i]);
  }
  x = A[1];
  int idx = 0, cnt = 0, pos = 1;
  for (int i = 2; i <= M; i++) {
    if (x == A[i] || x == B[i])
      chk[i] = 1;
    else
      idx = i;
  }
  y = A[idx];
  for (int i = 2; i <= M; i++) {
    if (!chk[i]) {
      if (y == A[i] || y == B[i]) continue;
      pos = 0;
      break;
    }
  }
  if (pos) ans = 1;
  pos = 1;
  y = B[idx];
  for (int i = 2; i <= M; i++) {
    if (!chk[i]) {
      if (y == A[i] || y == B[i]) continue;
      pos = 0;
      break;
    }
  }
  if (pos) ans = 1;
  x = B[1];
  idx = 0, cnt = 0, pos = 1;
  memset(chk, 0, sizeof(chk));
  for (int i = 2; i <= M; i++) {
    if (x == A[i] || x == B[i])
      chk[i] = 1;
    else
      idx = i;
  }
  y = A[idx];
  for (int i = 2; i <= M; i++) {
    if (!chk[i]) {
      if (y == A[i] || y == B[i]) continue;
      pos = 0;
      break;
    }
  }
  if (pos) ans = 1;
  pos = 1;
  y = B[idx];
  for (int i = 2; i <= M; i++) {
    if (!chk[i]) {
      if (y == A[i] || y == B[i]) continue;
      pos = 0;
      break;
    }
  }
  if (pos) ans = 1;
  if (ans)
    cout << "YES";
  else
    cout << "NO";
}
