You can withdraw the contract as long as both parties have not fully executed the contract.
If both parties have signed and fully executed the contract, you still have to comply with certain contingencies, perhaps if you cannot comply, you can pull out then.
Always speak with your attorney.
They have your best interests represented.
Good Luck.... more