#include <bits/stdc++.h>
using namespace std;
int a[300005], b[300005];
bool solve(int c1, int m) {
  int c2 = -1, c3 = -1;
  for (int i = 1; i <= m; i++) {
    if (a[i] != c1 && b[i] != c1) {
      c2 = a[i];
      c3 = b[i];
      break;
    }
  }
  if (c2 > 0 && c3 > 0) {
    int no = 0;
    for (int i = 1; i <= m; i++) {
      if (a[i] != c1 && a[i] != c2 && b[i] != c1 && b[i] != c2) {
        no++;
        break;
      }
    }
    for (int i = 1; i <= m; i++) {
      if (a[i] != c1 && a[i] != c3 && b[i] != c1 && b[i] != c3) {
        no++;
        break;
      }
    }
    return no < 2;
  }
  return true;
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a[i] >> b[i];
  }
  bool ans = solve(a[1], m) | solve(b[1], m);
  cout << (ans ? "YES" : "NO") << "\n";
  return 0;
}
