#include <bits/stdc++.h>
using namespace std;

int main(void)
{
  int64_t N, K;
  cin >> N >> K;

  for (int i = 0; i < K; i++)
  {
    if (N % 200 == 0)
    {
      N /= 200;
    }
    else
    {
      N = N * 1000 + 200;
    }
  }
  cout << N;
}

#include <bits/stdc++.h>
using namespace std;//gcd=__gcd swap(a,b)  
typedef long long ll;
ll md=1e9+7;
#define pb push_back
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pair<int,int>> vii;
typedef vector<pair<ll,ll>> vll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef unsigned long long ull;
#define mp make_pair
ull PowMod(ull a,ull n)
{
    ull ret = 1;
    while (n > 0) {
        if (n & 1) ret = ret * a % md;
        a = a * a % md;
        n >>= 1;
    }
    return ret;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll n,p;
    cin>>n>>p;
    ll a=PowMod(p-2,n-1);
    cout<<a*(p-1)%md;
    
    return 0;
}