                              //ABHISHEK AGRAWAL,BIT mesra//               
//Author: Abhishekagrawal  
//Date: 09/05/2021 
//Time: 18:34:50 
#include<bits/stdc++.h>
using namespace std;
#define booga cout << "booga" << endl
#define int long long int
#define pb push_back  
#define f first
#define s second
#define mod (ll)1000000007
#define pi (double)acos(-1.0)
#define what_is(x) cerr << #x << " is " << x << endl;
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define safai(...) Clearing_out(__VA_ARGS__)
void Clearing_out() { return; }
 
template <typename Head, typename... Tail>
void Clearing_out(Head &H, Tail & ... T) {
	H.clear();
	Clearing_out(T...);
}
 
const int N=200040;int a[N],b[N],c[N],ans,sum;
int n;

void testcase(){
  int k;
  cin>>k>>n;
  bool vis[100000];
  memset(vis,true,sizeof(vis));
  for(int i=1;i<=1000;i++){
    int cur=(100+k)*i;
    cur/=100;
    vis[cur]=false;
  }
  int x=1,cc=1;
  vector<int>v;
  for(int i=1;i<=1000;i++){
    if(vis[i]) v.push_back(i-(100+k-1)/k*(cc++));
  }
  int n1=(n-1)/k;
  int cu;
  if(n1==0) cu=0;
  else cu=(v[k-1]+1)*n1;
  n1=n%k;
  n1--;
  if(n1==-1) n1=k-1;
  cu+=v[n1];
  cout<<((100+k-1)/k)*n+cu;


  
  return;
}

int32_t main(){
  ios_base::sync_with_stdio(false);
  cin.tie(0);cout.tie(0); 
  /*Today's thought: Push yourself,because no one else is going to do it for you.*/
  int test=1;
  // cin>>test; 
  while(test--){
    testcase();
  } 
  cerr << "Time : " << 1000 *((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
  return 0;
}


#include<bits/stdc++.h>
#include<string.h>
#include<cstdio>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include<cstring>
#include<map>
#include<set>
#include<cstdlib>
#include<bitset>
using namespace std;
typedef long long ll;
char s[2003][2003];
ll mod=1e9+7;
ll ma[2003][2003]={0};
ll maxx[2003][2003]={0};
ll may[2003][2003]={0};
ll mas[2003][2003]={0};
ll h,w;
int main(void)
{
	scanf("%lld%lld",&h,&w);
	for(ll i=1;i<=h;i++)
	{
		scanf("%s",s[i]+1);
	}
	for(ll i=1;i<=h;i++)
	{
		for(ll j=1;j<=w;j++)
		{
			if(i==1&&j==1){ma[i][j]=maxx[i][j]=may[i][j]=mas[i][j]=1;continue;}
			if(s[i][j]=='#') ma[i][j]=maxx[i][j]=may[i][j]=mas[i][j]=0;
			else
			{
				ma[i][j]=maxx[i-1][j]+may[i][j-1]+mas[i-1][j-1];
				maxx[i][j]=ma[i][j]+maxx[i-1][j];
				may[i][j]=ma[i][j]+may[i][j-1];
				mas[i][j]=ma[i][j]+mas[i-1][j-1];
				ma[i][j]%=mod;
				maxx[i][j]%=mod;
				may[i][j]%=mod;
				mas[i][j]%=mod;
			}
		}
	}
	printf("%lld\n",ma[h][w]);
}