Only Pakistan, Sri Lanka know how to defeat terrorism: COAS