Ergodicity Criterion for Markov Shifts