You will color an array consisting of N cells numbered 1 to N for the array game party.
In the attic, there are two types of crayons, A and B, and M bags for each type, which the i-th bag has crayons with color i.
In each bag, there are several crayons having pairwise different thicknesses.
You have to color the cells like the following:
How many ways are there to color the N cells? Consider as a different way if at least one of the two bags you chose is different or the crayon you used to color a particular cell has a different type, color, or thickness.
The first line contains two integers N and M — the number of cells and the number of bags of each crayon type, respectively.
The second line contains M integers A_1,,A_2,,⋯,,A_M, where A_i is the number of crayons in the i-th bag of type A.
The third line contains M integers B_1,,B_2,,⋯,,B_M, where B_j is the number of crayons in the j-th bag of type B.
Print the number of ways to color the N cells, modulo 109+7.