@_=glob<>;$G=pop@_;$==$<;$G-=($_<($%=$G/($=/=--$|?2:5))?$_:$%)*$=for@_;print$G?NO:YES