Function isEqualOrParent