fn.cpp
//
// File: f1.cc
// Author: cteam029
//
// Created on October 19, 2013, 10:26 AM
//
#include <cstdlib>
#include <cstdio>
#include <map>
using namespace std;
//
//
//
int main(int argc, char** argv) {
map<int, int> mapa;
int a, b, x, y;
bool ok;
while(scanf("%d%d", &a, &b) == 2){
ok = false;
for(int i = 0; i < b; i++){
if(scanf("%d%d", &x, &y) == 2){
if(mapa.find(x) == mapa.end()){
mapa.insert(pair<int, int>(x, 1));
}else{
mapa[x]++;
}
if(mapa.find(y) == mapa.end()){
mapa.insert(pair<int, int>(y, 1));
}else{
mapa[y]++;
}
}
}
for(map<int, int>::iterator it = mapa.begin(); it != mapa.end(); ++it){
if((*it).second >= 4){
ok = true;
break;
}
}
if(ok){
printf("YES\n");
}else{
printf("NO\n");
}
}
return 0;
}