Stairs Again


There is a staircase of nn steps infront of you. You begin at step 1, and can jumps of sizes between aa and bb, or jumps of sizes between cc and dd. How many ways are there to reach step nn.

Input

The first line of input contains space-seperated integers n,a,b,c,dn,a,b,c,d.

Output

The number of ways of getting from step 11 to nn, modulo 109+710^9 + 7

Constraints

  • 10≤n≤10510 \le n \le 10^5
  • 1≤a≤b<c≤d≤1051 \le a \le b < c \le d \le 10^5

Example 1

In
Code 1
10 3 3 4 4
Out
Code 2
1

Example 2

In
Code 3
20 1 8 13 14
Out
Code 4
256213

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.