#include <bits/stdc++.h>
using namespace std;
bool check(vector<pair<int, int>>& arr, int l, int x, int y) {
  for (int i = 0; i < l; i++) {
    if (arr[i].first != x && arr[i].first != y && arr[i].second != x &&
        arr[i].second != y)
      return false;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> m >> n;
  vector<pair<int, int>> arr(n);
  map<pair<int, int>, int> freq;
  vector<pair<int, int>> val(m);
  for (int i = 0; i < m; i++) {
    val[i] = pair<int, int>(0, i + 1);
  }
  for (int i = 0; i < n; i++) {
    cin >> arr[i].first >> arr[i].second;
    val[arr[i].first - 1].first++;
    val[arr[i].second - 1].first++;
    if (freq.find(arr[i]) == freq.end())
      freq[arr[i]] = 1;
    else
      freq[arr[i]]++;
  }
  sort(val.begin(), val.end());
  for (int i = m - 1; i > 0; i--) {
    if (val[i].first + val[i - 1].first < n) break;
    for (int j = i - 1; j >= 0; j--) {
      if (val[i].first + val[j].first < n) break;
      pair<int, int> p1(val[i].second, val[j].second);
      pair<int, int> p2(val[j].second, val[i].second);
      if (freq.find(p1) == freq.end()) freq[p1] = 0;
      if (freq.find(p2) == freq.end()) freq[p2] = 0;
      if (val[i].first + val[j].first - freq[p1] - freq[p2] >= n) {
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
