n, m=gets.split.map &:to_i x, y=gets.split.map &:to_i m*=2 puts ~-x%m==~-y%m ? "YES" : "NO"