Unless company A issue u an NOC,there is no way you can work for company B till 2 years are over. I suggest you contact company A via email(hopefully they will respond) and inform them your situation.
If u know somebody in Qatar,he/she can help you negotiate wth company A on your behalf for NOC.
All the best