#include <bits/stdc++.h>
using namespace std;
int a[300005];
int b[300005];
int flag;
int main() {
  int n, m;
  cin >> n >> m;
  int i = 0, j = 0;
  for (i = 0; i < m; i++) {
    cin >> a[i];
    cin >> b[i];
    j++;
  }
  int hh = a[0], ff = b[0];
  int cc, fff;
  int temp = 0;
  for (int i = 0; i < m; i++) {
    if (a[i] == hh || b[i] == ff || a[i] == ff || b[i] == hh)
      continue;
    else {
      temp = 1;
      cc = a[i];
      fff = b[i];
      break;
    }
  }
  if (temp == 0) {
    printf("YES");
    return 0;
  }
  int sum = 0;
  for (int i = 0; i < m; i++) {
    if ((a[i] != hh && b[i] != hh) && (a[i] != cc && b[i] != cc)) sum++;
  }
  if (sum == 0) {
    printf("YES");
    return 0;
  }
  sum = 0;
  for (int i = 0; i < m; i++) {
    if ((a[i] != hh && b[i] != hh) && (a[i] != fff && b[i] != fff)) sum++;
  }
  if (sum == 0) {
    printf("YES");
    return 0;
  }
  sum = 0;
  for (int i = 0; i < m; i++) {
    if ((a[i] != ff && b[i] != ff) && (a[i] != cc && b[i] != cc)) sum++;
  }
  if (sum == 0) {
    printf("YES");
    return 0;
  }
  sum = 0;
  for (int i = 0; i < m; i++) {
    if ((a[i] != ff && b[i] != ff) && (a[i] != fff && b[i] != fff)) sum++;
  }
  if (sum == 0) {
    printf("YES");
    return 0;
  }
  if (sum != 0) printf("NO");
}
