Yamaha Parts 24x7 would help you waste less on the wrong screws. Hardware (as in hardware store nuts and bolts) tends not to be too costly. Even for a "dealer" part (car analogy).
You can also purchase the service manual which should have the correct specs for the screw - but I would personally (and have before) call up the parts team and have them look up the part, order it, and have it shipped.
Maybe also invest in Loctite and paint the threads to prevent future losses. Understand I'm not saying it's your fault for not using Loctite in the first place - but good preventative measures now that you're dealing with putting new ones in. Once bitten and all that ...
Current Yamaha Synthesizers: Montage Classic 7, Motif XF6, S90XS, MO6, EX5R