#include using namespace std; #define modulo 1000000007 #define mod(mod_x) ((((long long)mod_x+modulo))%modulo) #define Inf 10000000000000002 int main(){ int H,W; cin>>H>>W; vector> A(H,vector(W)); for(int i=0;iW){ vector> B(W,vector(H)); for(int i=0;i> Sl = A,Sr = A; for(int i=0;i=0;j--){ Sr[i][j] = mod(Sr[i][j] * Sr[i][j+1]); } } int Q; cin>>Q; for(int i=0;iW)swap(r,c); int ans = 1; for(int j=0;j