#include <bits/stdc++.h>
using namespace std;
int f[300005][2];
bool check(int x, int y, int m) {
  for (int i = 0; i < m; i++) {
    if (x != f[i][0] && x != f[i][1] && y != f[i][0] && y != f[i][1])
      return false;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  int prob[2][2] = {};
  for (int i = 0; i < m; i++) {
    cin >> f[i][0] >> f[i][1];
    if (i == 0) {
      prob[0][0] = f[0][0];
      prob[0][1] = f[0][1];
    } else if (f[i][0] != prob[0][0] && f[i][1] != prob[0][1] &&
               f[i][0] != prob[0][1] && f[i][1] != prob[0][0]) {
      prob[1][0] = f[i][0];
      prob[1][1] = f[i][1];
    }
  }
  if (prob[1][0] == 0 && prob[1][1] == 0) {
    cout << "YES";
    return 0;
  }
  if (check(prob[0][0], prob[1][0], m)) {
    cout << "YES";
  } else if (check(prob[0][0], prob[1][1], m)) {
    cout << "YES";
  } else if (check(prob[0][1], prob[1][0], m)) {
    cout << "YES";
  } else if (check(prob[0][1], prob[1][1], m)) {
    cout << "YES";
  } else
    cout << "NO";
}
