The second one is perfectly clear, and has no redundancies. If you removed the repeated words from the first example, it would be ambiguous. The second one is clearly better, but both are correct.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.