Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

The problem statement has recently been changed. View the changes.

×
F. Sonya and Informatics

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputA girl named Sonya is studying in the scientific lyceum of the Kingdom of Kremland. The teacher of computer science (Sonya's favorite subject!) invented a task for her.

Given an array $$$a$$$ of length $$$n$$$, consisting only of the numbers $$$0$$$ and $$$1$$$, and the number $$$k$$$. Exactly $$$k$$$ times the following happens:

- Two numbers $$$i$$$ and $$$j$$$ are chosen equiprobable such that ($$$1 \leq i < j \leq n$$$).
- The numbers in the $$$i$$$ and $$$j$$$ positions are swapped.

Sonya's task is to find the probability that after all the operations are completed, the $$$a$$$ array will be sorted in non-decreasing order. She turned to you for help. Help Sonya solve this problem.

It can be shown that the desired probability is either $$$0$$$ or it can be represented as $$$\dfrac{P}{Q}$$$, where $$$P$$$ and $$$Q$$$ are coprime integers and $$$Q \not\equiv 0~\pmod {10^9+7}$$$.

Input

The first line contains two integers $$$n$$$ and $$$k$$$ ($$$2 \leq n \leq 100, 1 \leq k \leq 10^9$$$) — the length of the array $$$a$$$ and the number of operations.

The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 1$$$) — the description of the array $$$a$$$.

Output

If the desired probability is $$$0$$$, print $$$0$$$, otherwise print the value $$$P \cdot Q^{-1}$$$ $$$\pmod {10^9+7}$$$, where $$$P$$$ and $$$Q$$$ are defined above.

Examples

Input

3 2 0 1 0

Output

333333336

Input

5 1 1 1 1 0 0

Output

0

Input

6 4 1 0 0 1 1 0

Output

968493834

Note

In the first example, all possible variants of the final array $$$a$$$, after applying exactly two operations: $$$(0, 1, 0)$$$, $$$(0, 0, 1)$$$, $$$(1, 0, 0)$$$, $$$(1, 0, 0)$$$, $$$(0, 1, 0)$$$, $$$(0, 0, 1)$$$, $$$(0, 0, 1)$$$, $$$(1, 0, 0)$$$, $$$(0, 1, 0)$$$. Therefore, the answer is $$$\dfrac{3}{9}=\dfrac{1}{3}$$$.

In the second example, the array will not be sorted in non-decreasing order after one operation, therefore the answer is $$$0$$$.

Codeforces (c) Copyright 2010-2022 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Sep/25/2022 12:00:50 (j3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|