Fluorescent 2
题号:NC17135
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

In ICPCCamp, there are n switches and m bulbs.The m bulbs are ON at the beginning.
Bobo knows in advance an n x m binary matrix Ci, j. When the i-th switch is pressed, all the bulbs j satisfying Ci, j = 1 flip its state between ON and OFF.
Let f(S) be the number of bulbs staying ON after the switches in set S is pressed. Find the sum of f(S)3 (cubic of f(S)) modulo (109+7) over all 2n possible choices of S.

输入描述:

The input consists of several test cases and is terminated by end-of-file.
The first line of each test case contains two integers n and m.
The i-th of the following n lines contains m integers Ci, 1, Ci, 2, ..., Ci, m.

输出描述:

For each test case, print an integer which denotes the result.
示例1

输入

复制
2 2
01
10
2 3
110
011

输出

复制
10
30

说明

For the first sample, there are 22 = 4 choices of S.
* S = \emptyset, f(S) = 2, f(S)^3 = 8.
* S = {1}, f(S) = 1, f(S)^3 = 1.
* S = {2}, f(S) = 1, f(S)^3 = 1.
* S = {1, 2}, f(S) = 0, f(S)^3 = 0.
Thus, the result is 8 + 1 + 1 + 0 = 10.

备注:

* 1 ≤ n ≤ 50
* 1 ≤ m ≤ 1000
* Ci, j ∈ {0, 1}
* The number of test cases does not exceed 500.
* The number of test cases with m > 50 does not exceed 1.