You are given two integers and . You are also given constraints in the form .
A sequence of length is if and only if:
- For each , it holds that .
- For each , the sum of all where is a multiple of is equal to under modulo . Formally, .
Find the number of all possible predisposed sequences. As the answer can be quite large, compute it modulo .