#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e5 + 5;
pair<int, int> a[MAXN];
int vis[MAXN];
int num[MAXN];
int n, m;
vector<pair<int, int>> vec;
int ans = false;
signed main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    int u, v;
    cin >> u >> v;
    if (u > v) swap(u, v);
    a[i] = make_pair(u, v);
  }
  sort(a + 1, a + 1 + m);
  for (int i = 1; i <= m; ++i) {
    if (a[i].first == a[1].first || a[i].second == a[1].first) vis[i] = 1;
  }
  for (int i = 1; i <= m; ++i) {
    if (!vis[i]) vec.push_back(a[i]);
  }
  int cnt;
  cnt = vec.size();
  for (int i = 0; i < vec.size(); ++i) {
    num[vec[i].first]++;
    num[vec[i].second]++;
  }
  for (int i = 1; i <= n; ++i) {
    if (num[i] == cnt) ans = true;
  }
  memset(vis, 0, sizeof(vis));
  memset(num, 0, sizeof(num));
  vec.clear();
  for (int i = 1; i <= m; ++i) {
    if (a[i].second == a[1].second || a[i].first == a[1].second) vis[i] = 1;
  }
  for (int i = 1; i <= m; ++i) {
    if (!vis[i]) vec.push_back(a[i]);
  }
  cnt = vec.size();
  for (int i = 0; i < vec.size(); ++i) {
    num[vec[i].first]++;
    num[vec[i].second]++;
  }
  for (int i = 1; i <= n; ++i) {
    if (num[i] == cnt) ans = true;
  }
  if (ans)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
