#include <bits/stdc++.h>
using namespace std;
char *p1, *p2, buf[1000000];
#define nc() (p1==p2 && (p2=(p1=buf)+fread(buf,1,1000000,stdin),p1==p2)?EOF:*p1++)
inline int rd()
{
int x = 0, f = 1; char c = nc();
while (c < 48 || c > 57) f = c == 47 ? -1 : 1, c = nc();
while (c >= 48 && c <= 57) x = x * 10 + c - 48, c = nc();
return x * f;
}
#define int long long
#define M 9901
int p[50000005], t[50000005], res = 1;
int qpow(int x, int y)
{
if (!y || x == 1) return 1;
if (y == 1) return x;
else if (y & 1) {
int q = qpow(x, y/2)%M;
return q*q*x%M;
}
else {
int q = qpow(x, y/2)%M;
return q*q%M;
}
}
signed main()
{
int a = rd(), b = rd(), c = 0, aa = a;
for (int x = 2; x <= a; ++x) {
if (!(aa%x)) {
p[++c] = x;
while (!(aa%x) && aa) {
aa /= x;
++t[c];
}
}
}
for (int i = 1; i <= c; ++i) res *= p[i] % M != 1?
((qpow(p[i]%M, b*t[i]+1)-1) * qpow((p[i]-1)%M, M-2)) % M :
(1 + b*t[i]) % M;
printf("%d", (res%M+M)%M);
return 0;
}