import Data.List m@main=getLine>>=putStrLn.f.words>>m (!)=isInfixOf f[x,y,z]|x!y,y!z="YES"|0<1="NO"