Starting with the balls in the order $12345,$ we make a table of the positions of the balls after each of the first 10 steps:
$$\begin{array}{c|c|ccccc}
\textbf{Step} & \textbf{Ball that moves} & \textbf{Order after step} \\
\hline 1 & \text{Rightmost} & 1\; 2\; 5\; 3\; 4 \\
2 & \text{Leftmost} & 2 \; 5 \; 1 \; 3 \; 4 \\
3 & \text{Rightmost} & 2 \; 5 \; 4 \; 1 \; 3 \\
4 & \text{Leftmost} & 5 \; 4 \; 2\; 1 \; 3 \\
5 & \text{Rightmost} & 5 \; 4 \; 3 \; 2 \; 1 \\
6 & \text{Leftmost} & 4 \; 3 \; 5 \; 2 \; 1 \\
7 & \text{Rightmost} & 4 \; 3 \; 1 \; 5 \; 2 \\
8 & \text{Leftmost} & 3 \; 1 \; 4 \; 5 \; 2 \\
9 & \text{Rightmost} & 3 \; 1 \; 2 \; 4 \; 5 \\
10 & \text{Leftmost} & 1 \; 2 \; 3 \; 4 \; 5
\end{array}$$
After $10$ steps, the balls are in the same order as at the beginning. This means that after each successive set of $10$ steps, the balls will be returned to their original order.
Since $2020$ is a multiple of $10,$ then after $2020$ steps, the balls will be in their original order. Steps $2021$ through $2025$ will repeat the outcomes of steps $1$ through $5$ above, and so after $2025$ steps, the balls will be in the reverse of their original order.
Therefore, $2025$ is a possible value of $N$.