#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> v;
vector<int> hash_arr(300005);
bool solve(int n, int num) {
  fill(hash_arr.begin(), hash_arr.end(), 0);
  int count = 0;
  for (auto &pair : v) {
    if (pair.first != num && pair.second != num)
      count++, hash_arr[pair.first]++, hash_arr[pair.second]++;
  }
  for (int i = 1; i <= n; i++)
    if (hash_arr[i] == count) return (true);
  return (false);
}
int main() {
  int n, m, a1, b1;
  cin >> n >> m;
  cin >> a1 >> b1;
  for (int i = 1; i < m; i++) {
    int a, b;
    cin >> a >> b;
    v.emplace_back(a, b);
  }
  if (solve(n, a1) || solve(n, b1))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return (0);
}
