Hey there! If possible, i would go to a local music store that carries them both and do a sound test to see which feel best to you!
From my experience, KRK Rokit 5 tend to be a bit bass heavy, which can feel great in the moment when you're creating depending on the type of music you're making, but can be misleading if you're planning on mixing your music on them. You may end up with a mix that actually lacks lowend presence because you've been hearing it though speakers that naturally boost those lower frequencies. If you're planning on having someone else mix your music and you want speakers that are going to give you the satisfaction of having that bass boost, go for it! Whatever helps your creative process.
I've worked out of countless home and professional studios that had the Yamaha HS5 which is generally a good indicator that the speakers are a good all around choice. I personally would go for the Yamaha's between the two :)
Goodluck and feel free to contact me directly with any other questions regarding your setup or production process in general.