#include <bits/stdc++.h>
using namespace std;
int fn(vector<pair<int, int>>& v, int n, int m, int x) {
  bool a[m];
  int i, p, q, cp = 0, cq = 0, cx = 0;
  for (i = 0; i < m; i++) {
    if (v[i].first == x || v[i].second == x) {
      a[i] = true;
      cx++;
    } else
      a[i] = false;
    if (v[i].first != x && v[i].second != x) {
      p = v[i].first;
      q = v[i].second;
    }
  }
  for (i = 0; i < m; i++) {
    if (a[i] == false) {
      if (v[i].first == p || v[i].second == p) cp++;
      if (v[i].first == q || v[i].second == q) cq++;
    }
  }
  int cy = max(cp, cq);
  if (cx + cy >= m)
    return 1;
  else
    return 0;
}
int main() {
  long long int n, m, a, b, x, y, ans = INT_MIN, i;
  cin >> n >> m;
  vector<pair<int, int>> v;
  for (i = 0; i < m; i++) {
    cin >> a >> b;
    v.push_back(make_pair(a, b));
  }
  int ans1 = fn(v, n, m, v[0].first);
  int ans2 = fn(v, n, m, v[0].second);
  if (ans1 == 1 || ans2 == 1)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
