#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  pair<int, int> a[m];
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    if (y < x) swap(x, y);
    a[i] = make_pair(x, y);
  }
  sort(a, a + m);
  int y = -1;
  for (int i = 1; i < m; i++) {
    if (!(a[i].first == a[0].first || a[i].first == a[0].second ||
          a[i].second == a[0].second || a[i].second == a[0].first)) {
      y = i;
    }
  }
  if (y == -1) {
    cout << "YES";
    return 0;
  }
  int x1 = a[0].first;
  int y1 = a[y].first;
  bool f = 1;
  for (int i = 1; i < m; i++) {
    if (i != y) {
      if (!(x1 == a[i].first || x1 == a[i].second || y1 == a[i].first ||
            y1 == a[i].second)) {
        f = 0;
        break;
      }
    }
  }
  if (!f) {
    f = 1;
    x1 = a[0].first;
    y1 = a[y].second;
    for (int i = 1; i < m; i++) {
      if (i != y) {
        if (!(x1 == a[i].first || x1 == a[i].second || y1 == a[i].first ||
              y1 == a[i].second)) {
          f = 0;
          break;
        }
      }
    }
  }
  if (!f) {
    f = 1;
    x1 = a[0].second;
    y1 = a[y].first;
    for (int i = 1; i < m; i++) {
      if (i != y) {
        if (!(x1 == a[i].first || x1 == a[i].second || y1 == a[i].first ||
              y1 == a[i].second)) {
          f = 0;
          break;
        }
      }
    }
  }
  if (!f) {
    f = 1;
    x1 = a[0].second;
    y1 = a[y].second;
    for (int i = 1; i < m; i++) {
      if (i != y) {
        if (!(x1 == a[i].first || x1 == a[i].second || y1 == a[i].first ||
              y1 == a[i].second)) {
          f = 0;
          break;
        }
      }
    }
  }
  if (f) {
    cout << "YES";
  } else
    cout << "NO";
  return 0;
}
