#include <iostream>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <cmath>
using namespace std;
const int MOD = 9901;
vector<pair<long long, long long> > fact;
long long a, b;
void calcFact(int a) {
for (int i = 2; i * i <= a; ++i) {
if (a % i == 0) {
long long putere = 0;
while(a % i == 0) {
++putere;
a /= i;
}
fact.push_back({i, putere * b});
}
}
if (a > 1) fact.push_back({a, b});
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
freopen("sumdiv.in", "r", stdin);
freopen("sumdiv.out", "w", stdout);
cin >> a >> b;
if (a == 0) {
cout << 0 << "\n";
exit(0);
}
if (a == 1 || b == 0) {
cout << 1 << "\n";
exit(0);
}
calcFact(a);
long long sum = 1;
for (auto& pereche : fact) {
long long baza = pereche.first;
long long exp = pereche.second;
sum = (sum * ((((long long)pow(baza, exp + 1) - 1) % MOD) / ((baza - 1) % MOD))) % MOD;
}
cout << sum << "\n";
return 0;
}