#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <climits>
using namespace std;

#define MOD 1000000007
#define PI 3.14159265358979323846264338327950288419

#define int long long
#define ll long long
#define pint pair<ll, ll>
#define pll pair<ll, ll>
#define pb push_back
#define mpair make_pair
#define pm(first, second) pb(mpair(first, second))
#define pff first.first
#define pfs first.second
#define psf second.first
#define pss second.second

#define all(X) (X).begin(), (X).end()
#define rall(X) (X).rbegin(), (X).rend()
#define divceil(a, b) (((a) + ((b) - 1)) / (b))
#define outyn(flag) cout << ((flag)? "Yes": "No") << endl
#define outYN(flag) cout << ((flag)? "YES": "NO") << endl
#define out(output) cout << (output) << endl

//pは素数,aのb乗をpで割った余り
ll powsur(ll a, ll b, ll p) {
	if (b == 0) {
		return 1;
	}
	else if (b%2 == 0) {
		ll d = powsur(a, b / 2, p);
		return ((d%p) * (d%p))%p;
	}
	else {
		return ((a%p) * (powsur(a, b - 1, p)%p))%p;
	}
}

void solve(){
    
    int N, P;
    cin >> N >> P;
    ll ans = (P - 1) * powsur(P - 2, N - 1, MOD);
    ans %= MOD;
    out(ans);

}

#undef int
int main(){

    solve();

    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mkp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define M1 1000000007
#define M2 998244353

#define fl(i,a,b)  for(ll i=a;i<b;i++)
#define bfl(i,a,b) for(ll i=b-1;i>=a;i--)
#define f(i,n)     for(int i=0;i<n;i++)
#define bf(i,n)    for(int i=n-1;i>=0;i--)
#define f1(i,n)    for(int i=1;i<=n;i++)
#define bf1(i,n)   for(int i=n;i>=1;i--)

#define all(v)      v.begin(),v.end()
#define pll         pair<long,long>
#define pii         pair<int,int>
#define vi          vector<int>
#define vll          vector<ll>


#define p0(a)       cout << a << " "
#define p1(a)       cout << a << bn
#define p2(a, b)    cout << a << " " << b << bn
#define p3(a, b, c) cout << a << " " << b << " " << c << bn
#define p4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << bn
#define debug(x)    cerr << #x << " = " << x << endl;

#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a,b),c)

#define bn          "\n"
#define pbn         cout<<"\n"



#define TRACE
#ifdef TRACE
    #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cerr << name << " : " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ',');
        cerr.write(names, comma - names) << " : " << arg1<<" | ";
        __f(comma+1, args...);
    }
#else
    #define trace(...) 1
#endif


ll modI(ll a,ll m);
ll gcd(ll a,ll b);
ll powM(ll x,ll y,ll m);


void py(int ok)
{
    if(ok==1){
        cout<<"YES"<<bn;
    }else{
        cout<<"NO"<<bn;
    }
}

void swap(ll& a,ll& b)
{
    ll tp=a;
    a=b;
    b=tp;
}

ll gcd(ll x,ll y)
{
    if(x==0) return y;
    return gcd(y%x,x);
}

ll lcm(ll x, ll y)
{
    if(x==0 || y==0){
        cout<<"Not valid lcm"<<bn;
    }
    
    ll LCM= x/gcd(x,y);
    LCM=LCM*y;
    
    return LCM;
}

ll powM(ll x,ll y,ll m)
{
    ll ans=1,r=1;
    x%=m;
    while(r>0&&r<=y)
    {
        if(r&y)
        {
            ans*=x;
            ans%=m;
        }
        r<<=1;
        x*=x;
        x%=m;
    }
    return ans;
}
 
ll modI(ll a, ll m)
{
    ll m0=m,y=0,x=1;
    if(m==1) return 0;
    while(a>1)
    {
        ll q=a/m;
        ll t=m;
        m=a%m;
        a=t;
        t=y;
        y=x-q*y;
        x=t;
    }
    if(x<0) x+=m0;
    return x;
}

//-----------------------------------------------------------------------------


int main() 
{
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(0);
	int tt=1;
    // cin>>tt;
   f1(testcase_no,tt)
   {
       //   cout<<"test case no. "<<testcase_no<<bn;
      
      double a,b;
      cin>>a>>b;
      
      
      double ans=a*(b/100);
      p1(ans);
      
     
     
     
       
        // cout << fixed << setprecision(25);
        
   }

	
	return 0;
}
