#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int MOD2 = 15000007;
const long long int MAX = 9187201950435737471;
const int N = 100005;
const int M = 100005;
const int INF = 2;
const double EPS = 1e-9;
const long double PI = acos(-1);
long long int po(long long int x, long long int y) {
  long long int ret = 1;
  while (y > 0) {
    if (y & 1) {
      ret = (ret * x);
    }
    y = y >> 1ll;
    x = (x * x);
  }
  return ret;
}
void solve(int T) {
  int n, m;
  cin >> n >> m;
  vector<int> a(m), b(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
  }
  int x = a[0], y = b[0];
  vector<pair<int, int> > v, d;
  for (int i = 0; i < m; i++) {
    if (a[i] != x && b[i] != x) {
      v.push_back({a[i], b[i]});
    }
    if (a[i] != y && b[i] != y) {
      d.push_back({a[i], b[i]});
    }
  }
  map<int, int> mp;
  bool ok = 0;
  if (v.size() == 0 || d.size() == 0) {
    cout << "YES\n";
    return;
  }
  for (int i = 0; i < v.size(); i++) {
    mp[v[i].first]++;
    mp[v[i].second]++;
    if (mp[v[i].first] == v.size() || mp[v[i].second] == v.size()) ok = 1;
  }
  if (ok) {
    cout << "YES\n";
    return;
  }
  ok = 0;
  mp.clear();
  for (int i = 0; i < d.size(); i++) {
    mp[d[i].first]++;
    mp[d[i].second]++;
    if (mp[d[i].first] == d.size() || mp[d[i].second] == d.size()) ok = 1;
  }
  if (ok) {
    cout << "YES\n";
    return;
  }
  cout << "NO\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  for (int i = 1; i <= T; i++) {
    solve(i);
  }
  return 0;
}
