#include <bits/stdc++.h>
using namespace std;
int n, m, d[300001], a[300001][2];
bool check;
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> a[i][0] >> a[i][1];
  for (int i = 0; i <= 1; i++) {
    int x = a[0][i];
    int cnt = 0, res = 0;
    for (int k = 1; k <= n; k++) d[k] = 0;
    for (int j = 0; j < m; j++)
      if (a[j][0] != x && a[j][1] != x)
        d[a[j][0]]++, d[a[j][1]]++, cnt++,
            res = max(max(d[a[j][0]], d[a[j][1]]), res);
    check |= (res == cnt);
  }
  if (check)
    cout << "YES";
  else
    cout << "NO";
}
