On characterization by order and prime graph for alternating groups