{
    \parindent=1cm
    \begin{tabular}{l@{\extracolsep{1cm}}l}
         Idea: & Mikhail Ivanov\\
         Development: & Mikhail Ivanov\\
     \end{tabular}
}

Imagine that the keyboard is two-sided infinite, and we enumerate its keys with integers. Note that each next key can be uniquely determined by its letter and the previous key. Let us construct the route on this infinite keyboard (starting with any number with proper residue mod 7) and store the reached minimum and maximum. Then, with jumps of seven, let us try to put these minimum and maximum into the segment $[0; 51]$: the answer is ``\texttt{YES}'' whenever it is possible. To check that, add the minimum number of sevens (possibly negative) such that the minimum is (still) non-negative, and check that the maximum is at most 51.