import java.util.*;
import java.lang.*;
import java.io.*;
class Graph
{
{
int ii = 0, k = 0;
Scanner in
= new Scanner
(System.
in); int n = in.nextInt();
int m = in.nextInt();
int[] v = new int[m], g = new int[m];
for (int i = 0; i < m; i ++)
{
v[i] = in.nextInt();
g[i] = in.nextInt();
}
while (p)
{
for (int j = ii+1; j < m; j ++)
{
if ((v[ii] == v[j]) && (g[ii] == g[j]))
{
k++;
p=false; //Выход из цикла.
}
}
ii ++;
if (ii == m) break; //Условие окончания цикла.
}
if (k
== 0) System.
out.
println("NO"); }
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBHcmFwaAp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQlpbnQgaWkgPSAwLCBrID0gMDsKCQlCb29sZWFuIHAgPSB0cnVlOwoJCVNjYW5uZXIgaW4gPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCWludCBuID0gaW4ubmV4dEludCgpOwoJCWludCBtID0gaW4ubmV4dEludCgpOwoJCWludFtdIHYgPSBuZXcgaW50W21dLCBnID0gbmV3IGludFttXTsKCQlmb3IgKGludCBpID0gMDsgaSA8IG07IGkgKyspCgkJewoJCQl2W2ldID0gaW4ubmV4dEludCgpOwoJCQlnW2ldID0gaW4ubmV4dEludCgpOwoJCX0KCQl3aGlsZSAocCkKCQl7CgkJCWZvciAoaW50IGogPSBpaSsxOyBqIDwgbTsgaiArKykKCQkJewoJCQkJaWYgKCh2W2lpXSA9PSB2W2pdKSAmJiAoZ1tpaV0gPT0gZ1tqXSkpIAoJCQkJeyAKCQkJCQlrKys7IAoJCQkJCVN5c3RlbS5vdXQucHJpbnRsbigiWUVTIik7IAoJCQkJCXA9ZmFsc2U7IC8v0JLRi9GF0L7QtCDQuNC3INGG0LjQutC70LAuCgkJCQl9CgkJCX0KCQkJaWkgKys7CgkJCWlmIChpaSA9PSBtKSBicmVhazsgLy/Qo9GB0LvQvtCy0LjQtSDQvtC60L7QvdGH0LDQvdC40Y8g0YbQuNC60LvQsC4KCQl9CgkJaWYgKGsgPT0gMCkgU3lzdGVtLm91dC5wcmludGxuKCJOTyIpOyAKCX0KfQ==