madar knew everything about yin and yan and the blood of the SO6P two son's, he didnt have the rinnegan then to read the end but he clearly states that he deciphered the rest in the manga, thats why he came back with the nine tails, it tells them they can control it with there sharingan,(the tablet) his whole goal was to become whole,so he needed both sides of the two sons, he was the closest blood line to the son with the SO6P eyes, and it was clear hashi was the closet bloodline to the son with the body of the SO6p. he jus found out that yan was the uchiha, evil in nature, the more they hate the more stronger they get hints y they can control 9 tails pure evil, and he knew hashi was pure of harted even as a kid, he would even die for him, the enemy, so he jus knew the hashi was the yin, the rest jus fell into place....