from typing import Tuple


def _check_IM_comb(IMi: str, IMj: str, im_comb: Tuple[str, str]):
    """Checks if the given IMs match the specified combination"""
    return (IMi == im_comb[0] and IMj == im_comb[1]) or (
        IMj == im_comb[0] and IMi == im_comb[1]
    )