#include <bits/stdc++.h>
using namespace std;
int n, m;
struct node {
  int a, b;
} nn[300005];
bool check(int a, int b) {
  for (int i = 0; i < m; i++) {
    if (nn[i].a != a && nn[i].b != a && nn[i].a != b && nn[i].b != b)
      return false;
  }
  return true;
}
int main() {
  scanf("%d %d", &n, &m);
  int a, b, c, d;
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &nn[i].a, &nn[i].b);
    if (i == 0) a = nn[i].a, b = nn[i].b;
    if (nn[i].a != a && nn[i].b != a && nn[i].a != b && nn[i].b != b)
      c = nn[i].a, d = nn[i].b;
  }
  int f = 0;
  if (check(a, b) || check(a, c) || check(a, d) || check(b, c) || check(b, d))
    f = 1;
  if (f)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
