#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  map<pair<int, int>, int> mp;
  map<int, int> mp1;
  vector<pair<int, int>> v;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    mp1[x]++;
    mp1[y]++;
    mp[{x, y}]++;
    mp[{y, x}]++;
  }
  bool f = 0;
  for (int i = 1; i <= n; i++) {
    v.push_back({mp1[i], i});
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    if (f) break;
    for (int j = i - 1; j > -1 && v[i].first + v[j].first >= m; j--) {
      int x = v[i].second, y = v[j].second;
      int ans = 0;
      ans += mp1[x];
      ans += mp1[y];
      ans -= mp[{x, y}];
      if (ans >= m) {
        f = 1;
        break;
      }
    }
  }
  if (f)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
