7. At the starting moment, a positive integer $N$ is written on the blackboard. In each step, Misha can choose a positive integer $a>1$ that is already written on the blackboard, erase it, and write down all its positive divisors except itself. It is known that after several steps, there are exactly $N^{2}$ numbers on the blackboard. Find all possible values of $N$.
7. It suffices to prove: For any positive integer $N$, the numbers written on the blackboard are always no more than $N^{2}$, and when $N \geqslant 2$, the numbers written on the blackboard are fewer than $N^{2}$.
Obviously, the conclusion holds for $N=1$.
For $N \geqslant 2$, assume the conclusion holds for all positive integers less than $N$. List the positive divisors of $N$ in ascending order as
$$
1=d_{1}<d_{2}<\cdots<d_{k}<d_{k+1}=N .
$$

According to the operation rules, the first step is to erase $N$ and write down $d_{1}, d_{2}, \cdots, d_{k}$. By the induction hypothesis, it is known that for any $d_{j}$ $(1 \leqslant j \leqslant k)$, the operation can produce at most $d_{j}^{2}$ numbers. Therefore, the number of numbers on the blackboard does not exceed $\sum_{j=1}^{k} d_{j}^{2}$.
Notice that, the positive divisors of $N$ can also be written as
$$
\begin{array}{l}
\frac{N}{d_{k+1}}<\frac{N}{d_{k}}<\cdots<\frac{N}{d_{2}}<\frac{N}{d_{1}} . \\
\text { Then } \sum_{j=1}^{k} d_{j}^{2}=\sum_{j=2}^{k+1} \frac{N^{2}}{d_{j}^{2}}=N^{2} \sum_{j=2}^{k+1} \frac{1}{d_{j}^{2}} \\
\leqslant N^{2} \sum_{j=2}^{N} \frac{1}{j^{2}}<N^{2} \sum_{j=2}^{N} \frac{1}{(j-1) j} \\
=N^{2} \sum_{j=2}^{N}\left(\frac{1}{j-1}-\frac{1}{j}\right)<N^{2} .
\end{array}
$$

Thus, in the case of $N$, the numbers written on the blackboard must be fewer than $N^{2}$.
By mathematical induction, the conclusion holds.
Furthermore, the only positive integer that satisfies the condition is $N=1$.