Ashi is interested in checking the algorithmic skills of her boyfriend. So, she sets up a special 2-D graph for him. The 2-D graph looks like a maze with N rows each containing N nodes.
To connect these nodes, Ashi uses the following algorithm:
Input:
There is only one line in input containing five space separated integers:
N k1 k2 k3 k4
Output:
Desired Output.
Constraints:
1 ≤ N ≤ 1000
1 ≤ k1, k2, k3, k4 ≤ 1000000000000000000
MOD = 1000000007