Problem in the code

here is my code https://ide.codingblocks.com/
please check why tle problem is coming is there any problem in the base case or where is the problem.

hi @himanshuanand729 code is correct,

  1. use DP
  2. take mod with 1e9+7 (as said in question)
    updated code https://ide.codingblocks.com/s/678862

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.