#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[3000005];
int n, m;
int x, y;
inline bool g(int second, int k) {
  for (int i = second + 1; i <= m; i++) {
    if (a[i].first != k && a[i].second != k && a[i].first != x &&
        a[i].second != x)
      return 0;
  }
  return 1;
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  int i;
  cin >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> a[i].first >> a[i].second;
  }
  x = a[1].first;
  for (i = 2; i <= m; i++) {
    if (a[i].first != x && a[i].second != x) {
      int k = max(g(i, a[i].first), g(i, a[i].second));
      if (k == 1) {
        cout << "YES";
        return 0;
      } else {
        break;
      }
    }
  }
  if (i > m) {
    cout << "YES";
    return 0;
  }
  x = a[1].second;
  for (i = 2; i <= m; i++) {
    if (a[i].first != x && a[i].second != x) {
      int k = max(g(i, a[i].first), g(i, a[i].second));
      if (k == 1) {
        cout << "YES";
        return 0;
      } else
        break;
    }
  }
  if (i > m) {
    cout << "YES";
  } else
    cout << "NO";
  return 0;
}
