def equal_mirror(t, s):
    """
    Returns whether t is the mirror image of s.
    """
    if t is None and s is None:
        return True
    if t is None or s is None:
        return False
    if t.value != s.value:
        return False
    return equal_mirror(t.left, s.right) and equal_mirror(t.right, s.left)