Hello JazzPedro and welcome to these forums. You'll find many helpful people here and a lot of useful information. Make sure that you get the excellent User Guide too:
http://www.cockos.com/reaper/userguide.php
OK, going back a step for clarification - are you recording audio or MIDI from the Yamaha?
For the MIDI Hardware output set to the M-Audio 410, its MIDI output is connected to the Yamaha input? Do you need to configure anything in the M-Audio? But, as the Yamaha P-115 is connected by USB, can you enable it as a MIDI Output device in Reaper's Preferences? Then select that on the track's "MIDI Hardware Output".
You might find it valuable to draw a diagram such as in post #3 here to show what's connected to what.
How to describe your hardware set-up (in Post #3)