summary:Let G be a finite group, and let N(G) be the set of conjugacy class sizes of G. By Thompson's conjecture, if L is a finite non-abelian simple group, G is a finite group with a trivial center, and N(G)=N(L), then L and G are isomorphic. Recently, Chen et al.\ contributed interestingly to Thompson's conjecture under a weak condition. They only used the group order and one or two special conjugacy class sizes of simple groups and characterized successfully sporadic simple groups (see Li's PhD dissertation). In this article, we investigate validity of Thompson's conjecture under a weak condition for the alternating groups of degrees p+1 and p+2, where p is a prime number. This work implies that Thompson's conjecture holds for the alternating groups of degree p+1 and p+2