Knowing the past improves cooperation in the future