This randomized phase II trial studies azacitidine with or without entinostat to see how well they work compared to azacitidine alone in treating patients with myelodysplastic syndromes, chronic myelomonocytic leukemia, or acute myeloid leukemia. Drugs used in chemotherapy, such as azacitidine, work in different ways to stop the growth of cancer cells, either by killing the cells, by stopping them from dividing, or by stopping them from spreading. Entinostat may stop the growth of cancer cells by blocking some of the enzymes needed for cell growth. Giving azacitidine together with entinostat may work better in treating patients with myelodysplastic syndromes, chronic myelomonocytic leukemia, or acute myeloid leukemia.