Kanchanaburi or Ayutthaya first?

To anyone who has done a similar journey / route, i am curious which one of these two locations it makes sense to visit first from Bangkok?

There seems to be no real direct transport between the two, with main links being from the capital. I want to visit both, then move onto more of the north. But which stop would you recommend first?

Thank you