#include <bits/stdc++.h>
using namespace std;
const long long mod = 7 + 1e9;
const long long N = 400004;
bool prime[N];
const long long H = 10;
void isprime() {
  memset(prime, true, N);
  for (long long i = 2; i * i < N; i++) {
    if (prime[i] == true) {
      for (long long j = i * i; j < N; j += i) {
        prime[j] = false;
      }
    }
  }
}
long long power(long long a, long long n) {
  long long ans = 1;
  a = a % mod;
  while (n > 0) {
    if (n & 1) {
      ans = (ans * a) % mod;
    }
    n = n >> 1;
    a = (a * a) % mod;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m;
  cin >> n >> m;
  vector<pair<long long, long long> > p;
  for (long long i = 0; i < m; i++) {
    long long x, y;
    cin >> x >> y;
    p.push_back(make_pair(x, y));
  }
  long long i;
  set<long long> d;
  for (i = 0; i < m; i++) {
    if (p[i].first != p[i].second) {
      break;
    } else {
      d.insert(p[i].first);
    }
  }
  if (i == m && d.size() != 2) {
    cout << "NO";
    return 0;
  } else if (i == m && d.size() == 2) {
    cout << "YES";
    return 0;
  }
  long long g = p[i].first;
  long long j;
  for (j = 0; j < m; j++) {
    if (p[j].first != g && p[j].second != g) {
      break;
    }
  }
  long long s = p[j].first;
  long long flag1 = 0;
  for (long long k = j; k < m; k++) {
    if (p[k].first != s && p[k].second != s && p[k].first != g &&
        p[k].second != g) {
      flag1 = 1;
      break;
    }
  }
  s = p[j].second;
  long long flag2 = 0;
  for (long long h = j; h < m; h++) {
    if (p[h].first != s && p[h].second != s && p[h].first != g &&
        p[h].second != g) {
      flag2 = 1;
      break;
    }
  }
  g = p[i].second;
  for (j = 0; j < m; j++) {
    if (p[j].first != g && p[j].second != g) {
      break;
    }
  }
  s = p[j].first;
  long long flag3 = 0;
  for (long long k = j; k < m; k++) {
    if (p[k].first != s && p[k].second != s && p[k].first != g &&
        p[k].second != g) {
      flag3 = 1;
      break;
    }
  }
  s = p[j].second;
  long long flag4 = 0;
  for (long long h = j; h < m; h++) {
    if (p[h].first != s && p[h].second != s && p[h].first != g &&
        p[h].second != g) {
      flag4 = 1;
      break;
    }
  }
  if ((flag1 == 0 || flag2 == 0) || (flag3 == 0 || flag4 == 0)) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
