If there is any valid sale agreement existing between A and B as on the date?
If so, if you still would like to go ahead with the purchase without any legal hassle, enter into a tripartite agreement with both of them and make the terms of payment accordingly.
The buyer of an immovable property (land, flat, apartment or shop) which is valued at Rs 50,00,000/-or more is required to pay a withholding tax to the government. The prevailing withholding tax is deducted at source, and is 1% of the consideration payable to the seller. It is the responsibility of the buyer to deduct the tax from payment to seller and deposit the same in the government treasury. Where the transaction is less than Rs 50,00,000 /-, the liability to deduct tax at source will not be applicable.
Therefore you may have to think about next step to be followed in this regard if you are going to pay the sale consideration amount above Rs. 50,00, 000/-
If the property is not in the name of B and if the B has not even entered into any sale agreement, then B has no role to play in this even though A and B may be having different kinds of understandings between them in respect of this property.
You consult an advocate in the local and take his opinion and advise on all such further issues.