Duality of Sp(2Nc) and SO(Nc) supersymmetric gauge theories with adjoint matter