#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  map<int, int> cnt1;
  map<pair<int, int>, int> cnt2;
  int x, y;
  bool flag = false;
  int mm = m;
  while (mm--) {
    int a, b;
    cin >> a >> b;
    if (a < b) swap(a, b);
    cnt1[a]++, cnt1[b]++, cnt2[make_pair(a, b)]++;
    if (!flag) {
      x = a, y = b;
      flag = true;
    }
  }
  bool ok = false;
  for (int i = 1; i <= n; i++) {
    if (i != x &&
        cnt1[i] + cnt1[x] - cnt2[make_pair(max(i, x), min(i, x))] == m) {
      ok = true;
      break;
    }
    if (i != y &&
        cnt1[i] + cnt1[y] - cnt2[make_pair(max(i, y), min(i, y))] == m) {
      ok = true;
      break;
    }
  }
  if (ok)
    cout << "YES";
  else
    cout << "NO";
}
