#include <bits/stdc++.h>
using namespace std;
long long n, m, a[300010], b[300010], cnt[300010];
bool solve(long long t) {
  for (int i = 1; i <= n; i++) cnt[i] = 0;
  long long all = 0;
  for (int i = 0; i < m; i++) {
    if (a[i] == t || b[i] == t) continue;
    all++;
    cnt[a[i]]++, cnt[b[i]]++;
  }
  for (int i = 1; i <= n; i++) {
    if (cnt[i] == all) return 1;
  }
  return 0;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
  }
  bool ans = 0;
  ans |= solve(a[0]);
  ans |= solve(b[0]);
  cout << (ans ? "YES" : "NO") << endl;
  return 0;
}
