    #include <bits/stdc++.h>
    #define ll long long
    #define fori(n) for( int i = 0; i < n; i++)
    #define all(x) x.begin(),x.end()
    #define pll pair < ll,ll >
    using namespace std;

    int main()
    {
        int n,m;
        cin >> n >> m;
        if(m%n==0)
        {
            cout << "Yes";
        }
        else
        {
            cout << "No";
        }
    }


#include <math.h>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, l, n) for (int i = (l); i < (n); i++)
#define max(p, q) ((p) > (q) ? (p) : (q))
#define min(p, q) ((p) < (q) ? (p) : (q))
#define mod
using ll = long long;
using P = pair<int, int>;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T> >;
const ll INF = 1e18 + 1;
ll f(ll a, ll n, ll p)
{
  if (n == 0)
    return 1;
  if (n == 1)
    return a % p;
  if (n % 2 == 1)
  {
    ll x = f(a, (n - 1) / 2, p);
    return a * x * x % p;
  }
  ll y = f(a, n / 2, p);
  return y * y % p;
}
int main()
{
  ll n, m;
  cin >> n >> m;
  ll ans = f(10, n, m * m);
  ans /= m;
  cout << ans % m << endl;
  return 0;
}
