Actually, I think they were dropping hints much earlier. In "Coming Back," the second episode, Ted's flash forward with Tracy is scored with Billy Joel's song Souvenir. Which is a haunting, sad, but beautiful song, which I'm sure Carter and Bays didn't just stumble into.