#include <bits/stdc++.h>
using namespace std;
const long long prime = 1e9 + 7;
const long long maxN = 1e5 + 1;
const long double pi = 3.1415926536;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m, a, b;
  cin >> n >> m;
  vector<pair<long long, long long>> pairs(m);
  for (long long i = (long long)(0); i <= (long long)(m - 1); i++) {
    cin >> a >> b;
    pairs[i] = make_pair(a, b);
  }
  vector<long long> x = {pairs[0].first, pairs[0].second};
  for (auto i : x) {
    vector<long long> cnt(n + 1, 0);
    long long no_x = 0;
    for (auto &j : pairs) {
      if ((j.first != i) && (j.second != i)) {
        cnt[j.first]++;
        cnt[j.second]++;
        no_x++;
      }
    }
    if (*max_element(cnt.begin(), cnt.end()) == no_x) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
