A search for a light charged Higgs boson () decaying to a W boson and a CP-odd Higgs boson () is performed using data from proton-proton collisions at \sqrt{s}=13~\mathrm{TeV}. The data were recorded by the CMS detector at the LHC in 2016 and correspond to an integrated luminosity of 35.9~\mathrm{fb}^{-1}. In this search, it is assumed that the boson is produced in decays of top quarks, and the boson decays to two opposite-charge muons. The presence of signals for boson masses between and 160~\mathrm{GeV} and boson masses between and 75~\mathrm{GeV} is investigated. No evidence for the production of the boson is found. Assuming branching ratios and , upper limits at confidence level on the branching fraction of the top quark, , of to are obtained, depending on the masses of the and bosons.