What is the purpose of “value % MOD” with a weird MOD number?
To avoid overflow while still being able to differentiate a solution.
The significance of choosing such a number is very important. first of all it helps solution to not overflow. Second of all it is a prime number . The prime number density decreases when you increase the number so you will get to see this number a lot and also 1000000007. Happy learning