#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> v(m);
  for (int i = 0; i < m; i++) {
    int u, p;
    cin >> u >> p;
    if (p < u) swap(u, p);
    v[i].first = u;
    v[i].second = p;
  }
  sort(v.begin(), v.end());
  int x = v[0].first;
  int idx = -1;
  for (int i = 0; i < m; i++) {
    if (v[i].first == x || v[i].second == x)
      continue;
    else {
      idx = i;
      break;
    }
  }
  if (idx == -1) {
    cout << "YES" << endl;
    return 0;
  }
  int y = v[idx].first;
  bool f = true;
  for (int i = idx; i < m; i++) {
    if (v[i].first == y || v[i].second == y || v[i].first == x ||
        v[i].second == x)
      continue;
    else {
      f = false;
      break;
    }
  }
  if (!f) {
    f = true;
    y = v[idx].second;
    for (int i = idx; i < m; i++) {
      if (v[i].first == y || v[i].second == y || v[i].first == x ||
          v[i].second == x)
        continue;
      else {
        f = false;
        break;
      }
    }
  }
  if (!f) {
    f = true;
    x = v[0].second;
    idx = -1;
    for (int i = 0; i < m; i++) {
      if (v[i].first == x || v[i].second == x)
        continue;
      else {
        idx = i;
        break;
      }
    }
    if (idx == -1) {
      cout << "YES" << endl;
      return 0;
    }
    y = v[idx].first;
    for (int i = idx; i < m; i++) {
      if (v[i].first == y || v[i].second == y || v[i].first == x ||
          v[i].second == x)
        continue;
      else {
        f = false;
        break;
      }
    }
    if (!f) {
      f = true;
      y = v[idx].second;
      for (int i = idx; i < m; i++) {
        if (v[i].first == y || v[i].second == y || v[i].first == x ||
            v[i].second == x)
          continue;
        else {
          f = false;
          break;
        }
      }
      if (!f) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  return 0;
}
