Fibosum hint mod

Can you please explain why do we need to add MOD and then take MOD?
Is it because i can get S(m) as a smaller value as compared to S(n-1) because i take MOD while calculting the compute function?

see MOD has to be added because
u do no know which one gives a bigger value F(m+2) OR F(N+1)
SO IF f{m+2 ) is smaller then the value would become -ve
and in case we add +mod to the expression then it would always lead to a +ve value

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.