#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> pairs;
bool ok(long long x, long long y) {
  for (pair<int, int> p : pairs) {
    if (p.first != x && p.first != y && p.second != x && p.second != y) {
      return false;
    }
  }
  return true;
}
int main() {
  long long n, m, a, b;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    pairs.emplace_back(a, b);
  }
  for (long long x : {pairs[0].first, pairs[0].second}) {
    if (ok(x, -1)) {
      cout << "YES";
      return 0;
    }
    for (long long i = 1; i < m; i++) {
      if (x != pairs[i].first && x != pairs[i].second) {
        if (ok(x, pairs[i].first) || ok(x, pairs[i].second)) {
          cout << "YES";
          return 0;
        }
        break;
      }
    }
  }
  cout << "NO";
  return 0;
}
