#include <iostream>
#include <map>
using namespace std;
// Function to calculate the factorial of a number
unsigned long long factorial(int n) {
if (n == 0 || n == 1)
return 1;
else
return n * factorial(n - 1);
}
int main() {
int n, m;
// Reading input until EOF (End of File)
while (cin >> n >> m) {
// Check if m is greater than n
if (m > n) {
cout << m << " does not divide " << n << "!\n";
continue;
}
// Calculate factorial of n
unsigned long long factN = factorial(n);
// Map to store prime factors of m and their counts
map<int, int> primeFactorsM;
// Factorize m
int tempM = m;
for (int i = 2; i * i <= tempM; ++i) {
while (tempM % i == 0) {
primeFactorsM[i]++;
tempM /= i;
}
}
if (tempM > 1) {
primeFactorsM[tempM]++;
}
// Check divisibility of m in n!
bool divides = true;
for (auto& factor : primeFactorsM) {
int prime = factor.first;
int count = factor.second;
// Calculate the power of prime in n!
unsigned long long temp = prime;
unsigned long long powerCount = 0;
while (temp <= n) {
powerCount += n / temp;
temp *= prime;
}
// If the power of prime in n! is less than count in m, m doesn't divide n!
if (powerCount < count) {
divides = false;
break;
}
}
// Output result
if (divides) {
cout << m << " divides " << n << "!\n";
} else {
cout << m << " does not divide " << n << "!\n";
}
}
return 0;
}