Independent Set

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Bobo has a binary sequence a_1a_2a_na\_{1} a\_2 \dots a\_{n}. And he wants to count the number of sequences as x_1,x_2,,x_nx\_1, x\_2, \dots, x\_n satisfying the following conditions modulo (109+7)(10^9+7).

  1. x_1,x_2,,x_nN0x\_1, x\_2, \dots, x\_n \in \mathbb{N}^0, x_1+x_2++x_n=mx\_1 + x\_2 + \dots + x\_n = m;
  2. For all 1in1 \leq i \leq n, a_ix_i=0a\_i \cdot x\_i = 0;
  3. For all 2in2 \leq i \leq n, x_i/2x_i=0x\_{\lfloor i / 2 \rfloor} \cdot x\_i = 0.

입력

The first line contains 22 integers n,mn, m (1n5000000,1m101 \leq n \leq 5000000, 1 \leq m \leq 10).

The second line contains nn integers a_1a_2a_na\_{1} a\_{2} \dots a\_{n} (0a_i10 \leq a\_i \leq 1).

출력

A single number denotes the number of sequence.