if it is a thunderbolt equipped iMac, both have to be thunderbolt. There is an apple support article somewhere than describes it.
I have been hoping someone would figure out an adapter to use the thunderbolt iMac as a screen to plug in an Xbox or other HDMI device, but nothing has come out yet.