Sounds like it could be either, but I'm inclined to think power supply, I'd try first resetting your SMU:
1) Turn off the computer by choosing Shut Down from the Apple menu, or by holding the power button until the computer turns off.
2) Unplug all cables from the computer, including the power cord.
3) Wait 10 seconds.
4) Plug in the power cord while simultaneously pressing and holding the power button on the back of the computer.
5) Let go of the power button.
6) Press the power button once more to start up your iMac.