#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << setprecision(10);
  ;
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> pairs;
  for (int i = 0; i < (int)m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    pairs.push_back({a, b});
  }
  vector<int> v;
  v.push_back(pairs[0].first);
  v.push_back(pairs[0].second);
  for (auto x : v) {
    vector<int> sz(n);
    int all = 0;
    for (auto c : pairs) {
      if (c.first != x && c.second != x) {
        sz[c.first]++;
        sz[c.second]++;
        all++;
      }
    }
    if (*max_element(sz.begin(), sz.end()) == all) return cout << "YES\n", 0;
  }
  return cout << "NO\n", 0;
}
