Modified paths Counting in a Rectangle
As mentioned in the comments, DP is a perfectly valid solution to the problem. If the numbers are too large to calculate directly the number of solutions, then you can take things mod 10^9 + 7 during intermediate steps, too. This will work out because $(a \% b + c \% b) \% b = (a + c) \% b$ (for positive numbers or programming languages that implement negative mod correctly such as Python.

For a more elegant approach, you can calculate directly using more combinatorics. You know the total number of paths in the rectangle before part of it was removed, so it suffices to count the number of paths that went through the removed portion. To do this, take a diagonal from the bottom left of each removed rectangle up and to the right until you reach the border, Any path that goes in the removed portion must hit this diagonal, so if you sum the number of paths there are through each spot on the diagonal, you know how many paths to remove from your total. To count the number of paths that go through a square, count the number of paths to that square and multiply by the number of paths from there to the finish.

A fancier version of this approach is to count directly the paths that avoid the removed portion. To do this, take a diagonal from the corner of the removed rectangle (but not including it) down and to the left until you reach the border. A path avoids the removed rectangle if and only if it goes through this diagonal, so you can sum the number of paths through each location on this diagonal. Again, multiply the number of paths to a point by the number of paths from that point.