The serial for the Exchange "Agent" is installed on the media server, but there is nothing on the Exchange Server itself. However, you will need to be sure that the Remote Agent is installed on the Exchange server, or the media server will not connect to it at all
If you will be upgrading the OS, and then Exchange, in place, there should be no need to re-install the Remote Agent
FWIW, I've always prefered to do upgrades by starting with a clean install of the OS, then clean installs of all Apps, migrating settings and data as necessary.