If you have paid attention to the behavior of CodeCup 3 Stefs during the competition,…
- User
If you have paid attention to the behavior of CodeCup 3 Stefs during the competition, you will find out that all Stefs are in love with Mustafa.
Amir has found a piece of paper on the server's desk (where Mustafa sits behind it) on which a string of valid parentheses is written in color, and each letter is a specific color. He realized that one of the Stephs had written parentheses with a special taste in color to win Mustafa's heart. He notices that Steph Ashagh used the cubism painting style.
Bracket string s s with length n Consider n. For each letter i i, m i m i is equal to the index of the open or closed parenthesis corresponding to the letter i Consider the string i. Since this parenthesis is valid, the value m i m i for each i There is i. For example, if our parentheses sequence is (())(), the sequence m m is equal to 4 , 3 , 2 , 1 , 6 , 5 It will be 4,3,2,1,6,5. A string is a cube coloring if it has the following properties:
Each letter in one of the colors of 1 k k is painted. letter color i i and letter color m i m i must be equal. If m i ≠ i
1 m i
=i−1 letter color i i with i
1 i−1 is different. If m i ≠ i + 1 m i
=i+1 letter color i i with i + 1 i+1 is different. Amir wants a different number of coloring pages s s with k k write the color under that piece of paper to amaze Mustafa more! Since this number is very large, take the remainder 1 0 9 + 7 10 9 Get +7 for it.
input In the first line, enter two numbers n n and k k has arrived. Then in the next line of the parentheses string s s has arrived. It is guaranteed s s is a valid parenthesis.
1 ≤ k ≤ n ≤ 200
000 1≤k≤n≤200 000 ∣ s ∣
n ∣s∣=n
output In the only remaining line of output is the number of coloring methods of Kobi s s with k k on the color 1 0 9 + 7 10 9 Print +7.
Example Sample entry 1 4 2 (()) Plain text Sample output 1 2 Plain text Sample entry 2 6 3 (())() Plain text Sample output 2 12
- Assistant