#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 5;
vector<int> G[N];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, t;
  cin >> n >> t;
  vector<pair<int, int> > v;
  for (int i = 0; i < t; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    v.push_back({x, y});
  }
  vector<int> p = {v[0].first, v[0].second};
  for (int i : p) {
    vector<int> val(n);
    int all = 0;
    for (auto c : v) {
      if (c.first != i && c.second != i) {
        val[c.first]++;
        val[c.second]++;
        all++;
      }
    }
    if (*max_element(val.begin(), val.end()) == all) {
      cout << "YES"
           << "\n";
      return 0;
    }
  }
  cout << "NO"
       << "\n";
}
