Yes, you can leave and re-enter as long as you keep your ticket and show it when you return.