Since they have the same x-coordinate, you can just find the length by subtracting the two y-values. So,
5 - (-2) = 7 units. So, your answer is B.
If you do it the other way around:
(-2) - 5 = -7 units, just take the positive part because length can't be negative.