#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a_, long long b_) {
  if (b_ > a_) swap(b_, a_);
  return (b_ == 0 ? a_ : gcd(b_, a_ % b_));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  vector<pair<int, int> > arr;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    arr.push_back(make_pair(a, b));
  }
  vector<int> v = {arr[0].first, arr[0].second};
  for (int x : v) {
    vector<int> temp(n + 1);
    int cnt = 0;
    for (auto i : arr) {
      if (i.first != x && i.second != x) {
        temp[i.first]++;
        temp[i.second]++;
        cnt++;
      }
    }
    if (*max_element(temp.begin(), temp.end()) == cnt) {
      cout << "YES"
           << "\n";
      return 0;
    }
  }
  cout << "NO"
       << "\n";
  return 0;
}
