#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m, a1, b1, x, y, index;
  cin >> n >> m >> a1 >> b1;
  x = a1;
  int a[m - 1], b[m - 1];
  for (int i = 0; i < m - 1; i++) cin >> a[i] >> b[i];
  bool ans1 = true;
  for (index = 0; index < m - 1; index++) {
    if (a[index] != x && b[index] != x) {
      y = a[index];
      break;
    }
  }
  for (int i = index + 1; i < m - 1; i++) {
    if (a[i] != x && b[i] != x && a[i] != y && b[i] != y) {
      ans1 = false;
      y = b[index];
      break;
    }
  }
  if (ans1)
    cout << "YES";
  else {
    ans1 = true;
    for (int i = index + 1; i < m - 1; i++) {
      if (a[i] != x && b[i] != x && a[i] != y && b[i] != y) {
        ans1 = false;
        break;
      }
    }
    if (ans1)
      cout << "YES";
    else {
      x = b1;
      ans1 = true;
      for (index = 0; index < m - 1; index++) {
        if (a[index] != x && b[index] != x) {
          y = a[index];
          break;
        }
      }
      for (int i = index + 1; i < m - 1; i++) {
        if (a[i] != x && b[i] != x && a[i] != y && b[i] != y) {
          ans1 = false;
          y = b[index];
          break;
        }
      }
      if (ans1)
        cout << "YES";
      else {
        ans1 = true;
        for (int i = index + 1; i < m - 1; i++) {
          if (a[i] != x && b[i] != x && a[i] != y && b[i] != y) {
            ans1 = false;
            break;
          }
        }
        if (ans1)
          cout << "YES";
        else {
          cout << "NO";
        }
      }
    }
  }
}
