CF1536E Omkar and Forest
Description
Omkar's most recent follower, Ajit, has entered the Holy Forest. Ajit realizes that Omkar's forest is an $ n $ by $ m $ grid ( $ 1 \leq n, m \leq 2000 $ ) of some non-negative integers. Since the forest is blessed by Omkar, it satisfies some special conditions:
1. For any two adjacent (sharing a side) cells, the absolute value of the difference of numbers in them is at most $ 1 $ .
2. If the number in some cell is strictly larger than $ 0 $ , it should be strictly greater than the number in at least one of the cells adjacent to it.
Unfortunately, Ajit is not fully worthy of Omkar's powers yet. He sees each cell as a "0" or a "#". If a cell is labeled as "0", then the number in it must equal $ 0 $ . Otherwise, the number in it can be any nonnegative integer.
Determine how many different assignments of elements exist such that these special conditions are satisfied. Two assignments are considered different if there exists at least one cell such that the numbers written in it in these assignments are different. Since the answer may be enormous, find the answer modulo $ 10^9+7 $ .
Input Format
N/A
Output Format
N/A
Explanation/Hint
For the first test case, the two valid assignments are
$ 0000\\ 0000\\ 0000 $
and
$ 0000\\ 0010\\ 0000 $