#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
bool iseven(long long int n) {
  if ((n & 1) == 0) return true;
  return false;
}
void print(long long int t) { cout << t; }
void print(int t) { cout << t; }
void print(string t) { cout << t; }
void print(char t) { cout << t; }
void print(double t) { cout << t; }
void print(long double t) { cout << t; }
template <class T, class V>
void print(pair<T, V> p);
template <class T>
void print(vector<T> v);
template <class T>
void print(set<T> v);
template <class T, class V>
void print(map<T, V> v);
template <class T>
void print(multiset<T> v);
template <class T, class V>
void print(pair<T, V> p) {
  cout << "{";
  print(p.first);
  cout << ",";
  print(p.second);
  cout << "}";
}
template <class T>
void print(vector<T> v) {
  cout << "[ ";
  for (T i : v) {
    print(i);
    cout << " ";
  }
  cout << "]";
}
template <class T>
void print(set<T> v) {
  cout << "[ ";
  for (T i : v) {
    print(i);
    cout << " ";
  }
  cout << "]";
}
template <class T>
void print(multiset<T> v) {
  cout << "[ ";
  for (T i : v) {
    print(i);
    cout << " ";
  }
  cout << "]";
}
template <class T, class V>
void print(map<T, V> v) {
  cout << "[ ";
  for (auto i : v) {
    print(i);
    cout << " ";
  }
  cout << "]";
}
bool check(long long int x, vector<pair<long long int, long long int>> &a) {
  long long int possible1 = -1, possible2 = -1;
  for (auto &p : a) {
    if (p.first != x && p.second != x) {
      possible1 = p.first;
      possible2 = p.second;
      break;
    }
  }
  bool flag = true;
  for (auto &p : a) {
    if (p.first != x && p.first != possible1 && p.second != x &&
        p.second != possible1) {
      flag = false;
      break;
    }
  }
  if (flag) {
    return true;
  }
  flag = true;
  for (auto &p : a) {
    if (p.first != x && p.first != possible2 && p.second != x &&
        p.second != possible2) {
      flag = false;
      break;
    }
  }
  return flag;
}
void solve() {
  long long int n, m;
  cin >> n >> m;
  vector<pair<long long int, long long int>> a(m);
  for (long long int i = 0; i < m; ++i) {
    cin >> a[i].first >> a[i].second;
  }
  set<long long int> s;
  for (long long int i = 0; i < m && s.size() <= 5; ++i) {
    s.insert(a[i].first);
    s.insert(a[i].second);
  }
  vector<long long int> b(s.begin(), s.end());
  long long int n2 = b.size();
  bool flag = false;
  for (long long int i = 0; i < n2; ++i) {
    if (check(b[i], a)) {
      flag = true;
      break;
    }
  }
  if (flag) {
    cout << "YES" << '\n';
  } else {
    cout << "NO" << '\n';
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
