People enjoy playing hopscotch, and Farmer John's cows have invented a variant for themselves. Clumsy animals weighing nearly a ton play it, so cow hopscotch almost always ends in disaster. The cows still set the board up nearly every afternoon.
The board is an R×C grid (2≤R≤100, 2≤C≤100). Each square holds one integer between 1 and K (1≤K≤R×C). A cow starts on the top-left square and reaches the bottom-right square with a sequence of jumps. A jump is valid only when all three of these conditions hold.
Count the different sequences of valid jumps that take a cow from the top-left square to the bottom-right square.
The first line contains the integers R, C, and K.
Each of the next R lines contains C integers. All of them are between 1 and K.
Print on one line the number of different ways to get from the top-left square to the bottom-right square, modulo 1000000007.