Symmetric polynomials vanishing on the shifted diagonals and Macdonald polynomials