#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5, M = 3e5 + 5;
int a[M], b[M], c[N];
inline int rd() {
  int sl = 0, fh = 1;
  char ch = getchar();
  while (ch < '0' || '9' < ch) {
    if (ch == '-') fh = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') sl = sl * 10 + ch - '0', ch = getchar();
  return sl * fh;
}
int main() {
  int n, m, x;
  n = rd();
  m = rd();
  for (int i = 0; i < m; ++i) {
    a[i] = rd();
    b[i] = rd();
  }
  x = a[0];
  int num = 0;
  for (int i = 0; i < m; ++i) {
    if (a[i] == x || b[i] == x) {
      continue;
    }
    num++;
    c[a[i]]++;
    c[b[i]]++;
  }
  if (!num) {
    cout << "YES" << endl;
    return 0;
  } else {
    for (int i = 1; i <= n; ++i) {
      if (c[i] == num) {
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  memset(c, 0, sizeof(c));
  x = b[0];
  num = 0;
  for (int i = 0; i < m; ++i) {
    if (a[i] == x || b[i] == x) {
      continue;
    }
    num++;
    c[a[i]]++;
    c[b[i]]++;
  }
  if (!num) {
    cout << "YES" << endl;
    return 0;
  } else {
    for (int i = 1; i <= n; ++i) {
      if (c[i] == num) {
        cout << "YES" << endl;
        return 0;
      }
    }
    cout << "NO" << endl;
    return 0;
  }
}
