#include <bits/stdc++.h>
using namespace std;
map<int, int> cnt;
map<pair<int, int>, int> s;
bool flag;
int main() {
  int n, m, a, b;
  cin >> n >> m >> a >> b;
  if (m == 1) flag = true;
  s[make_pair(a, b)]++;
  s[make_pair(b, a)]++;
  cnt[a]++;
  cnt[b]++;
  for (int i = 2; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    s[make_pair(x, y)]++;
    s[make_pair(y, x)]++;
    cnt[x]++;
    cnt[y]++;
  }
  for (int i = 1; i <= n; i++) {
    int u = i;
    int v = a;
    if (u != v) {
      if (cnt[u] + cnt[v] - s[make_pair(u, v)] == m) flag = true;
    }
    v = b;
    if (u != v) {
      if (cnt[u] + cnt[v] - s[make_pair(u, v)] == m) flag = true;
    }
  }
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
