For mod-5,we can define a machine as follows:
M = {(0,1,2,3,4), (0,1), (0), $\delta$, (2)}, where we read the string bit-wise and $$\delta(q, x) = (2q + x) \text{ mod } 5$$.
For mod-7, we can define a similar machine as follows:
M = {(0,1,2,3,4,5,6), (0,1), (0), $\delta$, (0,1,2,3,5,6)}, where we read the string bit-wise and $$\delta(q, x) = (2q + x) \text{ mod } 7$$.
Post this, we only need to take the product of this automata and we'll get the desired answer.
Here, we'll have 35 states, out of which 6 will be final ( which is obtained by the product of the respective final states.)