#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t;
  t = 1;
  for (long long tc = 0; tc < t; tc++) {
    long long n, m;
    cin >> n >> m;
    vector<pair<long long, long long> > arr(m);
    for (long long i1 = 0; i1 < m; i1++) cin >> arr[i1].first >> arr[i1].second;
    long long a = arr[0].first;
    set<long long> st;
    st.insert(0);
    for (long long i = 1; i < m; i++) {
      if (arr[i].first == a || arr[i].second == a) {
        st.insert(i);
      }
    }
    long long cnt1 = st.size();
    vector<long long> v(n + 5, 0);
    for (long long i = 0; i < m; i++) {
      if (!st.count(i)) {
        v[arr[i].first]++;
        v[arr[i].second]++;
      }
    }
    bool g1 = 0;
    for (long long x = 1; x <= n; x++) {
      if (x != a) {
        if (v[x] + cnt1 == m) {
          g1 = 1;
          break;
        }
      }
    }
    if (g1)
      cout << "YES"
           << "\n";
    else {
      long long a = arr[0].second;
      set<long long> st;
      st.insert(0);
      for (long long i = 1; i < m; i++) {
        if (arr[i].first == a || arr[i].second == a) {
          st.insert(i);
        }
      }
      long long cnt1 = st.size();
      vector<long long> v(n + 5, 0);
      for (long long i = 0; i < m; i++) {
        if (!st.count(i)) {
          v[arr[i].first]++;
          v[arr[i].second]++;
        }
      }
      bool g2 = 0;
      for (long long x = 1; x <= n; x++) {
        if (x != a) {
          if (v[x] + cnt1 == m) {
            g2 = 1;
            break;
          }
        }
      }
      if (g2)
        cout << "YES"
             << "\n";
      else
        cout << "NO"
             << "\n";
    }
  }
  return 0;
}
