#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, i, F, S, l;
  cin >> n >> m;
  vector<pair<long long int, long long int>> a(m);
  for (i = 0; i < m; i++) {
    cin >> a[i].first >> a[i].second;
  }
  F = a[0].first;
  S = 0;
  for (i = 0; i < m; i++) {
    l = a[i].first;
    n = a[i].second;
    if (l != F && n != F) {
      if (l != S && n != S) {
        if (S == 0)
          S = l;
        else
          break;
      }
    }
  }
  if (i == m) {
    cout << "YES" << endl;
    return 0;
  }
  S = 0;
  for (i = 0; i < m; i++) {
    l = a[i].first;
    n = a[i].second;
    if (l != F && n != F) {
      if (l != S && n != S) {
        if (S == 0)
          S = n;
        else
          break;
      }
    }
  }
  if (i == m) {
    cout << "YES" << endl;
    return 0;
  }
  F = a[0].second;
  S = 0;
  for (i = 0; i < m; i++) {
    l = a[i].first;
    n = a[i].second;
    if (l != F && n != F) {
      if (l != S && n != S) {
        if (S == 0)
          S = l;
        else
          break;
      }
    }
  }
  if (i == m) {
    cout << "YES" << endl;
    return 0;
  }
  S = 0;
  for (i = 0; i < m; i++) {
    l = a[i].first;
    n = a[i].second;
    if (l != F && n != F) {
      if (l != S && n != S) {
        if (S == 0)
          S = n;
        else
          break;
      }
    }
  }
  if (i == m) {
    cout << "YES" << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}
