#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
int a[maxn], b[maxn];
struct Node {
  int x, y;
} node[maxn];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &node[i].x, &node[i].y);
  }
  int x = node[0].x, y = node[0].y, p = 1, q = 1, aa = 0, bb = 0;
  for (int i = 1; i < m; i++) {
    if (x == node[i].x || x == node[i].y)
      p++;
    else {
      a[node[i].x]++;
      a[node[i].y]++;
      int t = max(a[node[i].x], a[node[i].y]);
      aa = max(aa, t);
    }
    if (y == node[i].x || y == node[i].y)
      q++;
    else {
      b[node[i].x]++;
      b[node[i].y]++;
      int t = max(b[node[i].x], b[node[i].y]);
      bb = max(bb, t);
    }
  }
  if (p + aa >= m || q + bb >= m)
    printf("YES\n");
  else
    printf("NO\n");
}
