#include <bits/stdc++.h>
using namespace std;
const int N = 300005;
int n, m, a[N][3], dif, ans, x, y;
int valid(int x, int i) { return a[i][1] == x || a[i][2] == x; }
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) scanf("%d%d", &a[i][1], &a[i][2]);
  for (int j = 1; j <= 2; ++j) {
    dif = 0;
    ans = 1;
    for (int i = 2; i <= m; ++i)
      if (!valid(a[1][j], i)) {
        if (dif == 0) {
          dif = 1;
          x = a[i][1];
          y = a[i][2];
        } else {
          if (!valid(x, i)) x = y;
          if (!valid(y, i)) y = x;
          if (!valid(x, i) && !valid(y, i)) {
            ans = 0;
            break;
          }
        }
      }
    if (ans) {
      puts("YES");
      return 0;
    }
  }
  puts("NO");
}
