#include <bits/stdc++.h>
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int x1, x2;
  int y11, y12, y21, y22;
  bool init[2] = {false, false};
  bool succ[4] = {true, true, true, true};
  bool res = succ[0] | succ[1] | succ[2] | succ[3];
  int a, b;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a, &b);
    if (!res) continue;
    if (i == 0) {
      x1 = a;
      x2 = b;
    } else {
      if (a != x1 && b != x1) {
        if (!init[0]) {
          y11 = a;
          y12 = b;
          init[0] = true;
        } else {
          if (succ[0] && a != y11 && b != y11) succ[0] = false;
          if (succ[1] && a != y12 && b != y12) succ[1] = false;
        }
      }
      if (a != x2 && b != x2) {
        if (!init[1]) {
          y21 = a;
          y22 = b;
          init[1] = true;
        } else {
          if (succ[2] && a != y21 && b != y21) succ[2] = false;
          if (succ[3] && a != y22 && b != y22) succ[3] = false;
        }
      }
    }
    res = succ[0] | succ[1] | succ[2] | succ[3];
  }
  if (res)
    printf("YES");
  else
    printf("NO");
  return 0;
}
