Yaws is caused by a bacteria called Treponema pertenue and you can catch it by direct contact with an infected person's sores.
Attribution: Avallain