This is not a complete answer. But it will tell you some hints.
You should know the following algorithm :
For example, we know $35123473$ is a multiple of $7$ in the following way.
First, divide it as $35｜123｜473$, then add $35+473=508$ (odd sections), and add $123$ (even sections). And calculate $508-123=385$. Since $385$ is a multiple of $7$, $35123473$ is a multiple of $7$.
So, let us come back to the original question.
From the above algorithm, we know we only need to look at the set of a number in a section. The number in a section has at most three digits.
So, we now know we only need to look at the following numbers as a number in a section.
By the way, when we look at them in mod $7$, we have
I think you should find a good algorithm from this idea.