A two-dimensional periodic system of differential equations with two hyperbolic periodic solutions is considered, it is assumed that heteroclinic solutions lie at the intersection of stable and unstable manifolds of fixed points, more precisely, the existence of a heteroclinic contour is assumed. We study the case when stable and unstable manifolds intersect nontransversally at points of at least one heteroclinic solution. There are various ways of nontransversally intersecting a stable manifold with an unstable manifold at the points of a heteroclinic solution. Earlier in the works of L. P. Shil’nikov, S. V. Gonchenko, B. F. Ivanov and other authors, it was assumed that at the points of non-transversal intersection of a stable and unstable manifold there is a tangency of no more than finite order. It follows from the works of these authors that there exist systems in which there are stable periodic solutions in the neighborhood of the heteroclinic contour. In this paper, heteroclinic contours are studied under the assumption that at the points of non-transversal intersection of the stable and unstable manifold at the points of the heteroclinic solution, tangency is not a tangency of finite order. It is shown that in the neighborhood of such a heteroclinic contour there is situated a countable set of periodic solutions whose characteristic exponents are separated from zero.