#include <bits/stdc++.h>
using namespace std;
int n, m;
int ch1[300010], ch2[300010];
pair<int, int> arr[300010];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &arr[i].first, &arr[i].second);
  }
  int no = arr[1].first, maxmax = 0, p = 0;
  for (int i = 1; i <= m; i++) {
    if (arr[i].first == no || arr[i].second == no) {
      p++;
      continue;
    }
    maxmax = max(maxmax, ++ch1[arr[i].first]);
    maxmax = max(maxmax, ++ch1[arr[i].second]);
  }
  if (p + maxmax >= m) {
    printf("YES");
    return 0;
  }
  no = arr[1].second, maxmax = 0, p = 0;
  for (int i = 1; i <= m; i++) {
    if (arr[i].first == no || arr[i].second == no) {
      p++;
      continue;
    }
    maxmax = max(maxmax, ++ch2[arr[i].first]);
    maxmax = max(maxmax, ++ch2[arr[i].second]);
  }
  if (p + maxmax >= m) {
    printf("YES");
    return 0;
  }
  printf("NO");
}
