I. Imperial Decree
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

The Emperor of Byteland loves to stroll through the inner courtyard of his palace on summer evenings. However, he recently grew tired of the usual sights and came up with a brilliant idea: to instruct his courtiers to paint the grass! To make the result fascinating, he devised intricate rules for selecting the area of grass to be painted.

The inner courtyard is a rectangle measuring $$$n \times m$$$ meters, divided into $$$1 \times 1$$$ meter squares. Two random points are chosen inside this rectangle, after which the rectangle with opposite corners at the given points and sides parallel to the sides of the courtyard is designated for painting the grass.

Each of the two points is selected according to the following procedure. Each $$$1 \times 1$$$ meter square located in the $$$i$$$-th row and $$$j$$$-th column is assigned a weight $$$p_{i,j}$$$. Let $$$P = \sum_{i=1}^{n}{\sum_{j=1}^{m}{p_{i,j}}}$$$. First, one of the squares is chosen with a probability of $$$\frac{p_{i,j}}{P}$$$. Then, the point is chosen uniformly at random within the selected square.

The Emperor enjoyed this event so much that he issued a decree for it to be held weekly. To estimate the costs to the treasury, you, as the court accountant, have been tasked with finding the expected value of the area of painted grass.

Input

The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 1500$$$): the number of rows and the number of columns of the courtyard.

The $$$i$$$-th of the following $$$n$$$ lines contains $$$m$$$ integers $$$p_{i,1}, p_{i,2}, \ldots, p_{i,m}$$$ ($$$0 \le p_{i,j} \le 250$$$): the weights of the corresponding squares in the $$$i$$$-th row.

It is guaranteed that at least one of the weights $$$p_{i,j}$$$ is not equal to $$$0$$$.

Output

Output the expected value of the area of painted grass modulo $$$10^9 + 7$$$.

Formally, let $$$M = 10^9 + 7$$$. It can be shown that the answer can be expressed as an irreducible fraction $$$\frac{p}{q}$$$, where $$$p$$$ and $$$q$$$ are integers and $$$q \not \equiv 0 \pmod{M}$$$. Output the integer equal to $$$p \cdot q^{-1} \bmod M$$$. In other words, output such an integer $$$x$$$ that $$$0 \le x \lt M$$$ and $$$x \cdot q \equiv p \pmod{M}$$$.

Examples
Input
3 4
0 1 1 9
1 4 1 1
8 1 0 1
Output
2
Input
5 5
47 39 34 40 92
84 43 40 42 89
15 22 64 18 38
63 61 26 48 57
90 88 21 26 83
Output
400000006
Note

In the first example test, we can show that the expected value of the area of painted grass is equal to $$$2$$$.