#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > vpi;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    vpi.push_back(make_pair(x, y));
  }
  vector<int> v;
  v.push_back(vpi[0].first);
  v.push_back(vpi[0].second);
  for (auto x : v) {
    vector<int> count(n + 1);
    int all = 0;
    for (auto y : vpi) {
      if (x != y.second && x != y.first) {
        count[y.second]++;
        count[y.first]++;
        all++;
      }
    }
    if (*max_element(count.begin(), count.end()) == all) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
}
