If you recently purchased it just return for service under warranty.
Usually defective/leaking capacitors. Open it up and look for any capacitors “doming up” at the top or leaking brown “goop” or any traces of burning on the circuit boards.
You don’t give us any idea of your experience level so I will say you will need to know how to desolder and solder electronic components.
Here is a link to the Yamaha A-S301/S501Service Manual:
Remember to download both parts into the same folder and unzip the first one —> voila pdf service manual.
Let us know how it goes.