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