#include <bits/stdc++.h>
using namespace std;
namespace io {
inline int rdi() {
  int v;
  cin >> v;
  return v;
}
inline long long rdll() {
  long long v;
  cin >> v;
  return v;
}
inline string rds() {
  string s;
  cin >> s;
  return s;
}
inline char rdc() {
  char c;
  cin >> c;
  return c;
}
template <class T>
void rdv(T beg_iter, T end_iter) {
  for (; beg_iter != end_iter; ++beg_iter) cin >> *beg_iter;
}
inline void wri(const int v) { cout << v; }
inline void wrll(const long long& v) { cout << v; }
inline void wrs(const string& s) { cout << s; }
inline void wrc(const char c) { cout << c; }
template <class T>
void wrv(T beg_iter, T end_iter, string separator = " ",
         string end_of_line = "\n") {
  for (; beg_iter != end_iter; ++beg_iter) {
    cout << *beg_iter;
    cout << separator;
  }
  cout << end_of_line;
}
}  // namespace io
using namespace io;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    x = (x * x) % p;
  }
  return res;
}
void solve();
int main() {
  int t = 1;
  while (t--) solve();
  return 0;
}
void solve() {
  int n = rdi(), m = rdi();
  vector<pair<int, int>> A;
  for (int i = 0; i < m; ++i) {
    int a = rdi(), b = rdi();
    A.push_back(make_pair(a, b));
  }
  int x1 = A[0].first, x2 = A[0].second;
  int y1 = x1, y2 = x2;
  for (int i = 1; i < m; ++i) {
    if (A[i].first != x1 && A[i].second != x1) {
      y1 = A[i].first;
      y2 = A[i].second;
      break;
    }
  }
  bool flag = 1;
  for (int i = 1; i < m; ++i) {
    if (A[i].first != x1 && A[i].second != x1 && A[i].first != y1 &&
        A[i].second != y1) {
      flag = 0;
      break;
    }
  }
  if (flag == 1) {
    cout << "YES" << '\n';
    return;
  }
  flag = 1;
  for (int i = 1; i < m; ++i) {
    if (A[i].first != x1 && A[i].second != x1 && A[i].first != y2 &&
        A[i].second != y2) {
      flag = 0;
      break;
    }
  }
  if (flag == 1) {
    cout << "YES" << '\n';
    return;
  }
  for (int i = 1; i < m; ++i) {
    if (A[i].first != x2 && A[i].second != x2) {
      y1 = A[i].first;
      y2 = A[i].second;
      break;
    }
  }
  flag = 1;
  for (int i = 1; i < m; ++i) {
    if (A[i].first != x2 && A[i].second != x2 && A[i].first != y1 &&
        A[i].second != y1) {
      flag = 0;
      break;
    }
  }
  if (flag == 1) {
    cout << "YES" << '\n';
    return;
  }
  flag = 1;
  for (int i = 1; i < m; ++i) {
    if (A[i].first != x2 && A[i].second != x2 && A[i].first != y2 &&
        A[i].second != y2) {
      flag = 0;
      break;
    }
  }
  if (flag == 1) {
    cout << "YES" << '\n';
    return;
  }
  cout << "NO" << '\n';
}
