def METHOD_NAME(subject):
    return len(subject.memberEnd) >= 2 and (
        (
            head_subject is subject.memberEnd[0].type
            and tail_subject is subject.memberEnd[1].type
        )
        or (
            head_subject is subject.memberEnd[1].type
            and tail_subject is subject.memberEnd[0].type
        )
    )