#include <bits/stdc++.h>
using namespace std;
bool meow(int x, int y, int m, vector<int>& a, vector<int>& b) {
  for (int i = 0; i < m; i++) {
    if (a[i] == x || a[i] == y || b[i] == x || b[i] == y) continue;
    if (y > 0) return 0;
    return meow(a[i], x, m, a, b) || meow(b[i], x, m, a, b);
  }
  return 1;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  vector<int> b(m);
  for (int i = 0; i < m; i++) cin >> a[i] >> b[i];
  if (meow(a[0], 0, m, a, b) || meow(b[0], 0, m, a, b))
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
