#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
inline int add(int a, int b) {
  a += b;
  return a >= 1000000007 ? a - 1000000007 : a;
}
inline int sub(int a, int b) {
  a -= b;
  return a < 0 ? a + 1000000007 : a;
}
inline int mul(int a, int b) { return (long long int)a * b % 1000000007; }
int Set(int N, int pos) { return N = N | (1 << pos); }
int Reset(int N, int pos) { return N = N & ~(1 << pos); }
bool Cheek(int N, int pos) { return (bool)(N & (1 << pos)); }
int fre[300009];
void Solve(int t) {
  int i, j, k, n, m, u, v, ans = 0;
  vector<pair<int, int> > edge;
  vector<int> node;
  scanf("%d %d", &(n), &(m));
  for (i = 1; i <= m; i++) {
    scanf("%d %d", &(u), &(v));
    if (u > v) swap(u, v);
    edge.push_back({u, v});
  }
  sort(edge.begin(), edge.end());
  ;
  (edge).erase(unique((edge.begin()), (edge.end())), (edge).end());
  for (auto it : edge) {
    u = it.first;
    v = it.second;
    fre[u]++;
    fre[v]++;
  }
  set<pair<int, int> > st;
  for (i = 1; i <= n; i++) {
    st.insert({fre[i], i});
  }
  int cnt = 0;
  while (!st.empty() && cnt < 10) {
    pair<int, int> pr = *st.rbegin();
    st.erase(pr);
    node.push_back(pr.second);
    cnt++;
  }
  sort(node.begin(), node.end());
  ;
  (node).erase(unique((node.begin()), (node.end())), (node).end());
  for (int i = 0; i < (int)node.size(); i++) {
    for (int j = 0; j < (int)node.size(); j++) {
      int x = node[i];
      int y = node[j];
      int fg = 1;
      for (auto it : edge) {
        u = it.first;
        v = it.second;
        if (u != x && u != y && v != x && v != y) fg = 0;
      }
      ans |= fg;
    }
  }
  if (ans)
    printf("YES\n");
  else
    printf("NO\n");
}
int main() {
  int t, T;
  T = 1;
  for (__typeof(t) t = 1; t <= T; t++) {
    Solve(t);
  }
  return 0;
}
