#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, f1, f2, ff1, ss1, ff2, ss2, flag = 0;
  cin >> n >> m;
  vector<pair<long long, long long>> v(m);
  for (long long i = 0; i < m; i++) {
    cin >> v[i].first >> v[i].second;
  }
  f1 = v[0].first;
  f2 = v[0].second;
  for (long long i = 1; i < m; i++) {
    if (v[i].first != f1 && v[i].second != f1) {
      ff1 = v[i].first;
      ss1 = v[i].second;
    }
  }
  for (long long i = 1; i < m; i++) {
    if (v[i].first != f2 && v[i].second != f2) {
      ff2 = v[i].first;
      ss2 = v[i].second;
    }
  }
  for (long long i = 0; i < m; i++) {
    if ((v[i].first != f1 && v[i].second != f1) &&
        (v[i].first != ff1 && v[i].second != ff1)) {
      flag++;
      break;
    }
  }
  if (flag == 1) {
    for (long long i = 0; i < m; i++) {
      if ((v[i].first != f1 && v[i].second != f1) &&
          (v[i].first != ss1 && v[i].second != ss1)) {
        flag++;
        break;
      }
    }
    if (flag == 2) {
      for (long long i = 0; i < m; i++) {
        if ((v[i].first != f2 && v[i].second != f2) &&
            (v[i].first != ff2 && v[i].second != ff2)) {
          flag++;
          break;
        }
      }
    }
    if (flag == 3) {
      for (long long i = 0; i < m; i++) {
        if ((v[i].first != f2 && v[i].second != f2) &&
            (v[i].first != ss2 && v[i].second != ss2)) {
          flag++;
          break;
        }
      }
    }
  }
  if (flag == 4)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
