#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e5 + 13;
int a[MAXN], b[MAXN];
bool check(vector<pair<int, int> > &A, int x) {
  vector<int> el;
  int i = 0;
  for (; i < int((A).size()); i++) {
    if (A[i].first == x || A[i].second == x) continue;
    el.push_back(i);
  }
  if (int((el).size()) == 0) return true;
  unordered_map<int, int> cnt;
  for (int e : el) {
    cnt[A[e].first]++;
    cnt[A[e].second]++;
    if (cnt[A[e].first] == int((el).size()) ||
        cnt[A[e].second] == int((el).size()))
      return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, x, y;
  while (cin >> n >> m) {
    vector<pair<int, int> > A(m);
    for (__typeof(0) i = (0); i < (m); i++) {
      cin >> A[i].first >> A[i].second;
    }
    if (check(A, A[0].first) || check(A, A[0].second)) {
      cout << "YES" << '\n';
    } else {
      cout << "NO" << '\n';
    }
  }
  return 0;
}
