#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v;
int fun(int x, int y) {
  int res = 1;
  for (int i = 0; i < v.size(); i++) {
    if (v[i].first != x && v[i].second != x && v[i].first != y &&
        v[i].second != y) {
      res = 0;
    }
  }
  return res;
}
int main() {
  int n, m;
  cin >> n >> m;
  int a = -1;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    v.push_back({x, y});
    if (v[0].first != x && v[0].second != x && v[0].first != y &&
        v[0].second != y) {
      a = i;
    }
  }
  if (a == -1) {
    cout << "YES" << endl;
    return 0;
  }
  int x, y;
  x = v[0].first;
  y = v[a].first;
  if (fun(x, y) == 1) {
    cout << "YES" << endl;
    return 0;
  }
  x = v[0].first;
  y = v[a].second;
  if (fun(x, y) == 1) {
    cout << "YES" << endl;
    return 0;
  }
  x = v[0].second;
  y = v[a].first;
  if (fun(x, y) == 1) {
    cout << "YES" << endl;
    return 0;
  }
  x = v[0].second;
  y = v[a].second;
  if (fun(x, y) == 1) {
    cout << "YES" << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}
