#include <cstdlib> #include <cstdio> #include <cstring> #include <cmath> using namespace std; int main() { int n, m; while (scanf("%d %d", &n, &m) == 2) { bool bunny = false; int *paws = new int[n]; memset(paws, 0, n*sizeof(int)); for (int i = 0; i < m; i++) { int x, y; scanf("%d %d", &x, &y); x--, y--; paws[x]++; paws[y]++; if (paws[x] == 4) bunny = true; if (paws[y] == 4) bunny = true; } printf(bunny ? "YES\n" : "NO\n"); } return 0; }