#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m, i, j;
  unordered_map<long long int, long long int> ma;
  cin >> n >> m;
  long long int point1, point2;
  long long int a1[300005], a2[300005];
  for (i = 0; i < m; i++) {
    cin >> a1[i] >> a2[i];
  }
  point1 = a1[0];
  point2 = a2[0];
  long long int flag = 0;
  for (i = 1; i < m; i++) {
    if (a1[i] != point1 && a1[i] != point2 && a2[i] != point1 &&
        a2[i] != point2) {
      flag = 1;
      break;
    }
  }
  if (flag == 0) {
    cout << "YES";
    return (0);
  }
  flag = 0;
  point1 = a1[0];
  long long int cou = 0;
  for (i = 1; i < m; i++) {
    if (a1[i] != point1 && a2[i] != point1 && cou == 0) {
      point2 = a1[i];
      cou = 1;
    }
    if (a1[i] != point1 && a1[i] != point2 && a2[i] != point1 &&
        a2[i] != point2 && cou == 1) {
      flag = 1;
      break;
    }
  }
  if (flag == 0) {
    cout << "YES";
    return (0);
  }
  flag = 0;
  cou = 0;
  for (i = 1; i < m; i++) {
    if (a1[i] != point1 && a2[i] != point1 && cou == 0) {
      point2 = a2[i];
      cou = 1;
    }
    if (a1[i] != point1 && a1[i] != point2 && a2[i] != point1 &&
        a2[i] != point2 && cou == 1) {
      flag = 1;
      break;
    }
  }
  if (flag == 0) {
    cout << "YES";
    return (0);
  }
  flag = 0;
  point1 = a2[0];
  cou = 0;
  for (i = 1; i < m; i++) {
    if (a1[i] != point1 && a2[i] != point1 && cou == 0) {
      point2 = a1[i];
      cou = 1;
    }
    if (a1[i] != point1 && a1[i] != point2 && a2[i] != point1 &&
        a2[i] != point2 && cou == 1) {
      flag = 1;
      break;
    }
  }
  if (flag == 0) {
    cout << "YES";
    return (0);
  }
  flag = 0;
  cou = 0;
  for (i = 1; i < m; i++) {
    if (a1[i] != point1 && a2[i] != point1 && cou == 0) {
      point2 = a2[i];
      cou = 1;
    }
    if (a1[i] != point1 && a1[i] != point2 && a2[i] != point1 &&
        a2[i] != point2 && cou == 1) {
      flag = 1;
      break;
    }
  }
  if (flag == 0) {
    cout << "YES";
    return (0);
  }
  cout << "NO";
}
