#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0) 
#define X first
#define Y second 
#define nl '\n'
#define AC return 0
#define pb(a) push_back(a) 
#define mst(a,b) memset(a, b, sizeof a)
#define rep(i,n) for(int i = 0; (i)<(n); i++)
#define rep1(i,n) for(int i = 1; (i)<=(n); i++)
#define scd(a) scanf("%lld", &a)
#define scdd(a,b) scanf("%lld%lld", &a, &b)
#define scs(s) scanf("%s", s)
//#pragma GCC optimize(2)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
const ll INF = (ll)0x3f3f3f3f3f3f3f, MAX = 9e18, MIN = -9e18;
const int N = 2e6+10, M = 2e6+10, mod = 1e9+7, inf = 0x3f3f3f3f;
ll f[N], inv[N]; 

ll q_pow(ll a, ll k)
{
	ll s = 1;
	while(k)
	{
		if(k & 1)	s = s * a % mod;
		a = a * a % mod;
		k >>= 1;
	}
	return s;
}

ll C(ll n, ll m)
{
	return f[n] * inv[m] % mod * inv[n - m] % mod;
}

int main()
{
	IOS;
	int _;
	// cin>>_;
	_ = 1;
	while(_--)
	{
		ll n, m, k;
		cin>>n>>m>>k;
		if(m + k < n)
		{
			cout<<0<<nl;
			AC;
		}
		f[0] = inv[0] = 1;
		rep1(i, N-5)	f[i] = f[i-1] * i % mod;
		inv[N-5] = q_pow(f[N-5], mod - 2);
		for(int i = N - 6; i > 0; i--)
			inv[i] = inv[i+1] * (i + 1) % mod;

		ll ans = (C(n + m, m) - C(n + m, n - (k+1)) + mod) % mod;
		cout<<ans<<nl;
	}
	
	
	AC;
} 

#include <bits/stdc++.h>
using namespace std;
const long long MOD=1000000007;
long long mod_pow(long long x,long long y){//x^yを返す//計算量は0(log(y))
  long long tmp=x,res=1;
  while(y){
    if(y%2){res=res*tmp%MOD;}
    y>>=1;
    tmp=tmp*tmp%MOD;
  }
  return res;
}
int main(){
  #define int long long
  int H,W;
  cin>>H>>W;
  vector<string> vec(H);
  for(int i=0;i<H;i++){
    cin>>vec.at(i);
  }
  vector<vector<int>> ans(H,vector<int>(W));
  vector<vector<int>> right(H,vector<int>(W,0));
  vector<vector<int>> down(H,vector<int>(W,0));
  vector<vector<int>> slice(H,vector<int>(W,0));
  for(int i=1;i<H;i++){
    if(vec.at(i).at(0)=='#'){break;}
    down.at(i).at(0)=mod_pow(2,i-1);
  }
  for(int i=1;i<W;i++){
    if(vec.at(0).at(i)=='#'){break;}
    right.at(0).at(i)=mod_pow(2,i-1);
  }
  for(int i=1;i<H;i++){
    for(int j=1;j<W;j++){
      if(vec.at(i).at(j)=='#'){continue;}
      if(vec.at(i).at(j-1)=='.'){
        right.at(i).at(j)=2*right.at(i).at(j-1)+slice.at(i).at(j-1)+down.at(i).at(j-1);
        //if(i==0 && j-1==0){right.at(i).at(j)++;}
        right.at(i).at(j)%=MOD;
      }
      if(vec.at(i-1).at(j-1)=='.'){
        slice.at(i).at(j)=right.at(i-1).at(j-1)+2*slice.at(i-1).at(j-1)+down.at(i-1).at(j-1);
        if(i-1==0 && j-1==0){slice.at(i).at(j)++;}
        slice.at(i).at(j)%=MOD;
      }
      if(vec.at(i-1).at(j)=='.'){
        down.at(i).at(j)=right.at(i-1).at(j)+slice.at(i-1).at(j)+2*down.at(i-1).at(j);
        //if(i-1==0 && j==0){down.at(i).at(j)++;}
        down.at(i).at(j)%=MOD;
      }
      //cout<<i<<" "<<j<<"    "<<down.at(i).at(j)<<" "<<right.at(i).at(j)<<" "<<slice.at(i).at(j)<<endl;
    }
  }
  int a=down.at(H-1).at(W-1)+right.at(H-1).at(W-1)+slice.at(H-1).at(W-1);
  a%=MOD;
  cout<<a<<endl;
}