#include <bits/stdc++.h>
const int MAXN = (int)3e5 + 5;
std::pair<int, int> p[MAXN];
int main() {
  int n, m;
  std::cin >> n >> m;
  for (int i = 1; i <= m; i++) scanf("%d%d", &p[i].first, &p[i].second);
  int x, y, copyi;
  int i;
  bool flag = false;
  x = p[1].first;
  for (i = 1; i <= m; i++) {
    if (x != p[i].second && x != p[i].first) break;
  }
  if (i > m)
    flag = true;
  else {
    copyi = i;
    y = p[i].first;
    for (; copyi <= m; copyi++) {
      if (y != p[copyi].second && y != p[copyi].first && x != p[copyi].second &&
          x != p[copyi].first)
        break;
    }
    if (copyi > m) flag = true;
    copyi = i;
    y = p[i].second;
    for (; copyi <= m; copyi++) {
      if (y != p[copyi].second && y != p[copyi].first && x != p[copyi].second &&
          x != p[copyi].first)
        break;
    }
    if (copyi > m) flag = true;
  }
  x = p[1].second;
  for (i = 1; i <= m; i++) {
    if (x != p[i].second && x != p[i].first) break;
  }
  if (i > m)
    flag = true;
  else {
    copyi = i;
    y = p[i].first;
    for (; copyi <= m; copyi++) {
      if (y != p[copyi].second && y != p[copyi].first && x != p[copyi].second &&
          x != p[copyi].first)
        break;
    }
    if (copyi > m) flag = true;
    copyi = i;
    y = p[i].second;
    for (; copyi <= m; copyi++) {
      if (y != p[copyi].second && y != p[copyi].first && x != p[copyi].second &&
          x != p[copyi].first)
        break;
    }
    if (copyi > m) flag = true;
  }
  if (flag)
    printf("YES");
  else
    printf("NO");
}
