#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 5;
long long a[N + 5], b[N + 5], cnt[N + 5];
long long n, m;
bool solv(long long x) {
  long long bc = 0;
  memset(cnt, 0, sizeof(cnt));
  for (long long i = 1; i <= m; i++) {
    if (a[i] == x || b[i] == x) {
      continue;
    }
    ++bc;
    ++cnt[a[i]], ++cnt[b[i]];
  }
  for (long long i = 1; i <= n; i++) {
    if (cnt[i] == bc) return 1;
  }
  return 0;
}
int32_t main() {
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) {
    cin >> a[i] >> b[i];
  }
  bool ans = solv(a[1]);
  ans |= solv(b[1]);
  cout << ((ans) ? "YES" : "NO");
  return 0;
}
