4.1. (12 points) In trapezoid $A B C D$ with bases $A D=17$ and $B C=9$, points $E$ and $F$ are marked on the bases respectively such that $M E N F$ is a rectangle, where $M$ and $N$ are the midpoints of the diagonals of the trapezoid. Find the length of segment $E F$.