A new class of inhomogeneous cosmological models with Yang-Mills fields