#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, i, u, v, flag = 0;
  cin >> n >> m;
  long long a[m], b[m];
  map<pair<long long, long long>, long long> m2;
  map<long long, long long> m1;
  map<long long, long long> m3;
  for (i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
    m2[make_pair(a[i], b[i])]++;
    m2[make_pair(b[i], a[i])]++;
    m1[a[i]]++;
    m1[b[i]]++;
  }
  map<long long, long long>::iterator it = m1.begin();
  for (i = 0; i < m; i++) {
    long long t = m1[a[i]] + m1[b[i]] - m2[{a[i], b[i]}];
    if (t == m) {
      flag = 1;
      break;
    }
  }
  if (flag == 1) {
    cout << "YES";
  } else {
    long long f = a[0], e = b[0], f1, e1;
    for (i = 0; i < m; i++) {
      if (a[i] != f && b[i] != f) {
        f1 = a[i];
        e1 = b[i];
      }
    }
    if (m1[f] + m1[f1] - m2[{f, f1}] == m) {
      flag = 1;
    } else if (m1[f] + m1[e1] - m2[{f, e1}] == m) {
      flag = 1;
    }
    for (i = 0; i < m; i++) {
      if (a[i] != e && b[i] != e) {
        f1 = a[i];
        e1 = b[i];
      }
    }
    if (m1[e] + m1[f1] - m2[{f, f1}] == m) {
      flag = 1;
    } else if (m1[e] + m1[e1] - m2[{f, e1}] == m) {
      flag = 1;
    }
    if (flag == 1) {
      cout << "YES";
    } else {
      cout << "NO";
    }
  }
  return 0;
}
