#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int m;
  cin >> n >> m;
  pair<int, int> a[m];
  for (int i = 0; i < m; ++i) {
    cin >> a[i].first >> a[i].second;
  }
  int x = a[0].first, x1 = a[0].second;
  vector<pair<int, int> > b[2];
  for (int i = 1; i < m; ++i) {
    if (a[i].first != x && a[i].second != x) b[0].push_back(a[i]);
  }
  for (int i = 1; i < m; ++i) {
    if (a[i].first != x1 && a[i].second != x1) b[1].push_back(a[i]);
  }
  if (b[0].size() == 0 || b[1].size() == 0) {
    cout << "YES";
    exit(0);
  }
  int nans = 0;
  for (auto g : b) {
    int y1 = g[0].first, y2 = g[0].second;
    for (int i = 1; i < g.size(); ++i) {
      if (y1 == g[i].first) {
        if (y2 != g[i].second) y2 = -1;
      } else if (y1 == g[i].second) {
        if (y2 != g[i].first) {
          y2 = -1;
        }
      } else {
        y1 = -1;
        if (y2 != g[i].second && y2 != g[i].first) {
          nans++;
          break;
        }
      }
    }
  }
  if (nans < 2)
    cout << "YES";
  else
    cout << "NO";
}
