#include <iostream>
#include <numeric>

using lint = long long;

void solve() {
    lint a, b;
    std::cin >> a >> b;

    auto g = std::gcd(a, b);
    a /= g, b /= g;

    while (b % 2 == 0) b /= 2;
    while (b % 5 == 0) b /= 5;
    std::cout << (b == 1 ? "No" : "Yes") << "\n";
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}