#include <bits/stdc++.h>
using namespace std;
int i, j, n, m, k;
int a[500000], b[500000];
int d[500000];
int check(int s) {
  for (int i = 1; i <= n; i++) d[i] = 0;
  int dem = 0;
  for (int i = 1; i <= m; i++) {
    if (a[i] == s || b[i] == s) {
      dem++;
    } else {
      d[a[i]]++;
      d[b[i]]++;
    }
  }
  for (int i = 0; i <= n; i++) {
    if (dem + d[i] == m) return 1;
  }
  return 0;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &a[i], &b[i]);
  }
  int tam1 = a[1];
  int tam2 = b[1];
  if (check(a[1]) == 1) {
    cout << "YES" << endl;
  } else if (check(b[1]) == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
