
#ifdef _DEBUG
#include "../../../library/src/debug_template.cpp"
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else
#define DMP(...) ((void)0)
#endif

#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <functional>

using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constexpr lint LINF = 1LL << 60;

struct init {
    init() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(10);
    }
} init_;

lint modpow(lint a, lint n, lint mod = MOD) {
    lint res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main() {

    lint N, M;
    cin >> N >> M;

    cout << modpow(10, N, M * M) / M % M << '\n';

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

bool solve(long long s, long long p) {
    p = 4 * p;
    long long up = min(p, (long long)sqrt(p) + 5);
    for (long long p1 = 1; p1 <= up; p1++) {
        if (p % p1 == 0 && 2 * s == p1 + p / p1) return true;
    }
    return false;
}

int main() {
    ios_base::sync_with_stdio(false), cin.tie(0);

    long long s, p;
    cin >> s >> p;
    cout << (solve(s, p) ? "Yes" : "No") << "\n";

    return 0;
}
