#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, m;
  cin >> n >> m;
  vector<pair<long long, long long> > mas(m);
  for (auto &i : mas) {
    cin >> i.first >> i.second;
  }
  long long x = mas[0].second;
  set<long long> a;
  vector<pair<long long, long long> > kek;
  for (auto &i : mas) {
    if (i.first != x && i.second != x) {
      a.insert(i.first);
      a.insert(i.second);
      kek.push_back(i);
    }
  }
  for (auto &it : a) {
    bool ok = 1;
    for (auto &i : kek) {
      if (it != i.first && it != i.second) {
        ok = 0;
        break;
      }
    }
    if (ok) {
      cout << "YES";
      return 0;
    }
  }
  x = mas[0].first;
  a.clear();
  kek.clear();
  for (auto &i : mas) {
    if (i.first != x && i.second != x) {
      a.insert(i.first);
      a.insert(i.second);
      kek.push_back(i);
    }
  }
  if (kek.size() == 0) {
    cout << "YES";
    return 0;
  }
  for (auto &it : a) {
    bool ok = 1;
    for (auto &i : kek) {
      if (it != i.first && it != i.second) {
        ok = 0;
        break;
      }
    }
    if (ok) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
