2. Given a positive integer $N<10^{2020}$, when 7 is placed at the first position of $N$, the resulting number is 5 times the number formed when 7 is placed at the last position of $N$. Then the number of all different values of $N$ is $\qquad$.
2. 336.

Let $N$ have $m$ digits, $m \leqslant 2020$.
When 7 is at the first position of $N$, the number formed is
$$
7 \times 10^{m}+N ;
$$

When 7 is at the last position of $N$, the number formed is $10 N+7$.
Then $7 \times 10^{m}+N=5(10 N+7)$
$$
\Rightarrow 7 N=10^{m}-5 \text {. }
$$

When $m$ takes values $1,2, \cdots, n, \cdots$, $10^{m}-5$ accordingly becomes
$$
5,95, \cdots, \underset{n-1 \uparrow}{99 \cdots 95}, \cdots,
$$

One of these that is divisible by 7 is 99995, at this point,
$$
N=14285, m=5 \text {. }
$$

Since 7|999 999, thus, when $m=6 k+5$, $N$ is an integer, hence
$$
m=6 k+5 \leqslant 2 \quad 020 \Rightarrow 0 \leqslant k \leqslant 335 \frac{5}{6} .
$$

Therefore, $N$ has $335+1=336$ different values.