Goodness of fit test for higher order binary Markov chain models