Do both arteries and veins contain valves?
All veins contain valves.
Only two arteries (Pulmonary trunk & aorta) have valves, others don't.
Valves in the circulatory system maintain the direction of blood flow.
Our heart pumps blood. And arteries carry the blood from heart to tissue. The pumping of the heart propagates blood through arteries. So, arteries don't have valves, except two. Pulmonary trunk and aorta have valves in their commencement to prevent backflow. These two valves are usually regarded as heart valves.
Picture of heart valves, see the pulmonary and aortic valves at the commencement of pulmonary trunk and aorta :
On the other hand, veins carry blood from tissues to the heart. Here, to ensure the flow of blood in only one direction (from tissue to heart) valves are necessary. So all veins have valves.
Diagram of valves in veins: