#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
int n, m;
int first[maxn], second[maxn];
void solve() {
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) cin >> first[i] >> second[i];
  int a, b;
  a = first[1];
  b = -1;
  for (int i = 1; i <= m; ++i) {
    if (first[i] != a && second[i] != a) {
      if (first[i] != b && second[i] != b) {
        if (b == -1)
          b = first[i];
        else
          break;
      }
    }
    if (i == m) {
      puts("YES");
      return;
    }
  }
  a = -1;
  b = second[1];
  for (int i = 1; i <= m; ++i) {
    if (first[i] != b && second[i] != b) {
      if (first[i] != a && second[i] != a) {
        if (a == -1)
          a = first[i];
        else
          break;
      }
    }
    if (i == m) {
      puts("YES");
      return;
    }
  }
  a = -1;
  b = second[1];
  for (int i = 1; i <= m; ++i) {
    if (first[i] != b && second[i] != b) {
      if (first[i] != a && second[i] != a) {
        if (a == -1)
          a = second[i];
        else
          break;
      }
    }
    if (i == m) {
      puts("YES");
      return;
    }
  }
  a = first[1];
  b = -1;
  for (int i = 1; i <= m; ++i) {
    if (first[i] != a && second[i] != a) {
      if (first[i] != b && second[i] != b) {
        if (b == -1)
          b = second[i];
        else
          break;
      }
    }
    if (i == m) {
      puts("YES");
      return;
    }
  }
  puts("NO");
}
int main() { solve(); }
