#include <bits/stdc++.h>
using namespace std;
int check(int a, int b, vector<pair<int, int> > v) {
  for (int i = 0; i < v.size(); i++) {
    if (a != v[i].first && a != v[i].second && b != v[i].first &&
        b != v[i].second)
      return 0;
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > v(m);
  vector<int> p;
  for (int i = 0; i < m; i++) {
    cin >> v[i].first >> v[i].second;
  }
  int a = v[0].first;
  int b = v[0].second;
  for (int i = 0; i < m; i++) {
    if (a != v[i].first && a != v[i].second && b != v[i].first &&
        b != v[i].second) {
      p.push_back(a);
      p.push_back(b);
      p.push_back(v[i].first);
      p.push_back(v[i].second);
      break;
    }
  }
  if (p.size() == 0) {
    cout << "YES";
    return 0;
  }
  for (int i = 0; i < p.size(); i++) {
    for (int j = i + 1; j < p.size(); j++) {
      if (check(p[i], p[j], v)) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
