10. (20 points) Let the sequence of non-negative integers $\left\{a_{n}\right\}$ satisfy:
$$
a_{n} \leqslant n(n \geqslant 1) \text {, and } \sum_{k=1}^{n-1} \cos \frac{\pi a_{k}}{n}=0(n \geqslant 2) \text {. }
$$

Find all possible values of $a_{2021}$.