Cohen-Macaulay binomial edge ideals of small deviation