They are both correct. " In English we can use ellipsis - leave words out and the meaning is still there. I don't know the rule for the second one but it sounds better to my ear.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.