Learning Dynamics from Input-Output Data with Hamiltonian Gaussian Processes