#include <bits/stdc++.h>
using namespace std;
pair<long long int, long long int> p[300002];
int see(long long int a, long long int b, long long int c) {
  for (long long int i = 0; i < c; i++) {
    if (p[i].first == a || p[i].first == b || p[i].second == a ||
        p[i].second == b)
      continue;
    if (b == -1)
      return see(a, p[i].first, c) || see(a, p[i].second, c);
    else
      return 0;
  }
  return 1;
}
int main() {
  long long int n, m, i;
  cin >> n >> m;
  for (i = 0; i < m; i++) cin >> p[i].first >> p[i].second;
  if (see(p[0].first, -1, m) || see(p[0].second, -1, m))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
