However, there is one thing you have to consider: B can file a mechanics lien on your property and try to foreclose it whether you have paid to A or not. To clear this lien is a time consuming prosess.
One of my friends had similar situation: He hired and PAID a contractor to build a house. However, the contractor ordered the materials without paying the venders, then ran off to FL with his money. The venders put a lien on his house. He reported to police regarding the contractor's criminal action. But this lien ruined his credit for years.
If you do not help B now, you might face much bigger trouble than A's anger.