You didn't mention whether the motherboard has SATA3 ports so, we'll assume that the motherboard has only SATA2 ports since it came with SATA2 cables.
In this case, the SATA2 cables that you have will work fine with your new SSD, as is. Of course, you will not receive the benefit of higher speeds that you would have if there were SATA3 ports on the motherboard.
There is no "sexing" of the cables. No M-M, F-F....
The motherboard is ASRock Z77 Pro4-M. The manufacturer's website says it comes with 2 cables but doesn't specify whether they are SATA 2 or 3. I found a review, where the reviewer says they're SATA 2. Anyway, I need 3 cables as I'll be connecting a HDD, an SSD and an optical drive (3 devices in total).
Is this the cable I need? It says it's male-to-male: http://www.waeplus.co.uk/product/1912982/SATA-cable-6GB%2C-SATA-III-0%2C50M-Sata-Male
Can't find the female-to-female ones but I definitely saw them in a couple of places.