#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 7;
int fir[maxn], sec[maxn];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) scanf("%d %d", fir + i, sec + i);
  for (int flag = 1; flag < 3; flag++) {
    int ind = (flag == 1 ? fir[1] : sec[1]);
    int ind2, ok = 1, j;
    for (j = 2; j <= m; j++) {
      if (fir[j] == ind || sec[j] == ind) {
        continue;
      }
      ok = 0;
      break;
    }
    if (ok == 1) {
      cout << "YES" << endl;
      return 0;
    }
    for (int flag2 = 1; flag2 < 3; flag2++) {
      ind2 = (flag2 == 1 ? fir[j] : sec[j]);
      ok = 1;
      for (int k = j + 1; k <= m; k++) {
        if (fir[k] == ind || fir[k] == ind2 || sec[k] == ind || sec[k] == ind2)
          continue;
        ok = 0;
        break;
      }
      if (ok == 1) {
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
