#include <bits/stdc++.h>
using namespace std;
double pi = 2 * acos(0.0);
const long long int INF = 1e9 + 7;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return (a / gcd(a, b)) * b;
}
long long int power(long long int x, long long int y, long long int m) {
  long long int res = 1;
  x = x % m;
  while (y > 0) {
    if (y & 1) res = (res * x) % m;
    y = y >> 1;
    x = (x * x) % m;
  }
  return res % m;
}
void WetPitch() {
  long long int n, m;
  cin >> n >> m;
  vector<pair<int, int>> pairs;
  for (long long int i = 0; i < m; i++) {
    long long int x, y;
    cin >> x >> y;
    pairs.push_back({x, y});
  }
  vector<int> val = {pairs[0].first, pairs[0].second};
  for (auto x : val) {
    vector<int> cnt(300005, 0);
    long long int count = 0;
    for (int i = 1; i < m; i++) {
      if (x != pairs[i].first && x != pairs[i].second) {
        cnt[pairs[i].first]++;
        cnt[pairs[i].second]++;
        count++;
      }
    }
    if (count == *max_element(cnt.begin(), cnt.end())) {
      cout << "YES" << '\n';
      return;
    }
  }
  cout << "NO" << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int tst;
  tst = 1;
  while (tst--) {
    WetPitch();
  }
  return 0;
}
