General condition of unidirectional mode conversion in periodic waveguide