#include <bits/stdc++.h>
using namespace std;
bool ok = false;
int n, m;
vector<pair<int, int>> v(300000);
void cal(int x) {
  vector<pair<int, int>> t;
  for (int i = 0; i < m; i++) {
    if (v[i].first == x || v[i].second == x) continue;
    t.push_back({v[i].first, v[i].second});
  }
  int mx = 0;
  map<int, int> mp;
  for (int i = 0; i < t.size(); i++) {
    int u = t[i].first;
    int v = t[i].second;
    mp[u]++;
    mx = max(mx, mp[u]);
    mp[v]++;
    mx = max(mx, mp[v]);
  }
  if (mx == t.size()) ok = true;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int i;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    v[i] = make_pair(a, b);
  }
  cal(v[0].first);
  cal(v[0].second);
  if (ok)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
