#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  long long a[m], b[m];
  for (int i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
  }
  long long t = a[0];
  bool ans1 = true, ans2 = true, ans3 = true, ans4 = true;
  int i = 0;
  while (a[i] == t || b[i] == t) {
    i++;
    if (i == m) {
      ans1 = true;
      break;
    }
  }
  if (i < m) {
    long long t1 = a[i];
    for (long long j = i; j < m; j++) {
      if (a[j] != t && b[j] != t && a[j] != t1 && b[j] != t1) {
        ans1 = false;
        break;
      }
    }
    long long t2 = b[i];
    for (long long j = i; j < m; j++) {
      if (a[j] != t && b[j] != t && a[j] != t2 && b[j] != t2) {
        ans2 = false;
        break;
      }
    }
  }
  i = 0;
  t = b[0];
  while (a[i] == t || b[i] == t) {
    i++;
    if (i == m) {
      ans1 = true;
      break;
    }
  }
  if (i < m) {
    long long t1 = a[i];
    for (long long j = i; j < m; j++) {
      if (a[j] != t && b[j] != t && a[j] != t1 && b[j] != t1) {
        ans3 = false;
        break;
      }
    }
    long long t2 = b[i];
    for (long long j = i; j < m; j++) {
      if (a[j] != t && b[j] != t && a[j] != t2 && b[j] != t2) {
        ans4 = false;
        break;
      }
    }
  }
  bool ans = ans1 | ans2 | ans3 | ans4;
  if (ans) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
