Of course it is possible and very easy. Connect a cable with two RCA at one end and one 3,5mm jack at the other end like this
between your imac
and your Yamaha. In details you have to connect the 3,5mm jack at the audio out of the imac
and the two RCA jacks at any free line level audio in at your Yamaha (like aux, tuner, cd etc)
In case of a problem or clarification, don't hesitate to post me a reply before rejecting my answer. If you didn't get the connections that I described above, ask me to create a diagram for you.If you are satisfied, rate my solution with the "thumbs" or (even better) add a testimonial.
Thanks and regards
Please kindly rate this solution