I would definitely try to have A's and B's for all the prerequisite classes. I guess the more important question would be whether you were able to understand the material. If you don't have a handle on the basics, you'll have a really tough time at the master's level.