The word order in Russian usually is VERY free.
The both sentences you wrote are perfectly correct.