#include <bits/stdc++.h>
using namespace std;
int a[300010] = {0};
map<int, map<int, int> > p;
int main() {
  int n, m;
  cin >> n >> m;
  int x, y;
  cin >> x >> y;
  int ax = x, ay = y;
  a[x]++;
  a[y]++;
  p[x][y]++;
  p[y][x]++;
  for (int i = 1; i < m; i++) {
    cin >> x >> y;
    a[x]++;
    a[y]++;
    p[x][y]++;
    p[y][x]++;
  }
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    if (i != ax) {
      if (a[ax] + a[i] - p[ax][i] == m) {
        flag = 1;
        break;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i != ay) {
      if (a[ay] + a[i] - p[ay][i] == m) {
        flag = 1;
        break;
      }
    }
  }
  if (flag == 0) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
  return 0;
}
