They are both grammatical; however, the first version is not normal. It's both archaic and poetic. The second version, while not as common as other ways of writing it, is at least modern—and fine in certain contexts.
– Jason BassfordJul 08 '20 at 22:19