Tilling problem II

question link:https://hack.codingblocks.com/contests/c/547/1045

  1. What is the best way to %(10^9+7). You can see how I have done it in the code. But I do think my code is not an efficient one. Do comment how can I make it more efficient. Also, is there any Top-to-Bottom approach to this question.
    Code link with DP www.ideone.com/FVyWUd

Hey Nipun, for doing %(10^9+7) just use this simple formula of modular arithmetics

a%1000000007 = b%1000000007 + c%1000000007 ;

And for further knowledge of it you can refer modular arithmetics videos in number theory section of your online course.