The disclosure relates to quinazoline derivative compounds represented by formulae (VA) & (VB) and compositions thereof, wherein the variables are as defined in the specifications. The compounds are suitable for modulating the activity of RAF kinases, including BRAF kinase and for the treatment, prevention, or amelioration of one or more symptoms of disease or disorder mediated by RAF kinases, thereby making them useful for treating a cancer selected form melanoma, papillary thyroid carcinoma, colorectal, ovarian, breast cancer, endometrial cancer, liver cancer, sarcoma, stomach cancer, Barret's adenocarcinoma, glioma, small cell lung cancer, non small cell lung cancer, head and neck cancer, acute lymphoblastic leukemia or non-Hodgkin's lymphoma; these compounds are also useful for treating inflammatory disease selected form immune dysfunction, immunodeficiency, immunomodulation, autoimmune disease, tissue transplant rejection, graft-versus-host disease, wound healing, kidney disease, multiple sclerosis, thyroiditis, type 1 diabetes, sarcoidosis, allergic rhinitis, inflammatory bowel disease, systemic lupus erythematosis, arthritis, osteoarthritis, rheumatoid arthritis, osteoporosis, asthma or chronic obstructive pulmonary disease.