#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
bool check_two(long long first, long long second, vector<long long> &a,
               vector<long long> &b) {
  for (long long i = 0; i < (long long)(a).size(); i++) {
    if (first == a[i] || first == b[i]) {
      continue;
    } else if (second == a[i] || second == b[i]) {
      continue;
    }
    return false;
  }
  return true;
}
bool check(long long first, vector<long long> &a, vector<long long> &b) {
  map<long long, long long> mp;
  for (long long i = 0; i < (long long)(a).size(); i++) {
    if (first == a[i] || first == b[i]) {
      continue;
    }
    return (check_two(first, a[i], a, b) || check_two(first, b[i], a, b));
  }
  return true;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m), b(m);
  for (long long i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
  }
  if (check(a[0], a, b) || check(b[0], a, b)) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
  return 0;
}
