print eval(q(Gc=$`;$d=$';Ge=$`-$c;$f=$'-$d;2)=~s'G'grep{/ /;$'gr)>4?YES:NO