$/=$";print+(<>+<>-2)%<>-<>+1?"NO":"YES"