PUMaC 2019 Number Theory A Problem 5

Call a positive integer n \mathit{compact}~ if for any infinite sequence of distinct primes p_1, p_2, \ldots there exists a finite subsequence of n primes p_{x_1}, p_{x_2}, \ldots, p_{x_n} (where the x_i are distinct) such that
p_{x_1}p_{x_2} \ldots p_{x_n} \equiv 1 \pmod{2019}.
Find the sum of all compact numbers less than 2 \cdot 2019.