If (2, p) is the midpoint of the line segment joining the points A(6, -5) and B(-2, 11), find the value of p.