#include <bits/stdc++.h>
using namespace std;
const long long INF = 922337203685477110;
const long long N = 300005;
const long long mod = 1e9 + 7;
const long long M = 22;
vector<pair<long long, long long> > v;
long long vis[N];
bool check(long long y) {
  for (long long i = 0; i < v.size(); i++) {
    if (!vis[i]) continue;
    if (v[i].first != y && v[i].second != y) return 0;
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m;
  cin >> n >> m;
  while (m--) {
    long long a, b;
    cin >> a >> b;
    v.push_back({a, b});
  }
  long long x = v[0].first;
  long long y1 = -1, y2 = -1;
  for (long long i = 0; i < v.size(); i++) {
    if (v[i].first != x && v[i].second != x) {
      y1 = v[i].first;
      y2 = v[i].second;
      vis[i] = 1;
    }
  }
  if (check(y1) || check(y2))
    cout << "YES"
         << "\n";
  else {
    x = v[0].second;
    y1 = -1, y2 = -1;
    memset(vis, 0, sizeof(vis));
    for (long long i = 0; i < v.size(); i++) {
      if (v[i].first != x && v[i].second != x) {
        y1 = v[i].first;
        y2 = v[i].second;
        vis[i] = 1;
      }
    }
    if (check(y1) || check(y2))
      cout << "YES"
           << "\n";
    else
      cout << "NO"
           << "\n";
  }
}
