#include <bits/stdc++.h>
using namespace std;
int main() {
  int T = 1;
  while (T--) {
    int n, m;
    cin >> n >> m;
    map<int, int> mp;
    vector<pair<int, int> > pp;
    for (int i = 0; i < m; i++) {
      int a, b;
      cin >> a >> b;
      pp.push_back({a, b});
      if (a != b) {
        mp[a]++;
        mp[b]++;
      } else
        mp[a]++;
    }
    vector<pair<int, int> > maxi;
    for (auto x : mp) {
      maxi.push_back({x.second, x.first});
    }
    sort(maxi.rbegin(), maxi.rend());
    int mm = min(4, int((maxi).size()));
    for (int q = 0; q < mm; q++) {
      vector<int> v(m, 0);
      int cnt = 0;
      for (int i = 0; i < m; i++) {
        if (pp[i].first == maxi[q].second || pp[i].second == maxi[q].second) {
          v[i] = 1;
          cnt++;
        }
      }
      cnt = m - cnt;
      if (cnt == 0) {
        cout << "YES";
        exit(0);
      }
      mp.clear();
      for (int i = 0; i < m; i++) {
        if (v[i] == 0) {
          if (pp[i].first != pp[i].second) {
            mp[pp[i].first]++;
            mp[pp[i].second]++;
          } else
            mp[pp[i].first]++;
        }
      }
      for (auto x : mp) {
        if (x.second == cnt) {
          cout << "YES";
          exit(0);
        }
      }
    }
    cout << "NO";
  }
  return 0;
}
