#include<bits/stdc++.h>

using namespace std;

int main()
{
	int m,h;
	cin >> m >> h;
	if(h % m == 0)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
template <typename T>
T modpow(T base, T exp, T modulus) {
  base %= modulus;
  T result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % modulus;
    base = (base * base) % modulus;
    exp >>= 1;
  }
  return result;
}
int main(){
  ll n, m;
  cin >> n >> m;
  cout << (modpow((ll)10,n,m*m)/m)%m<<endl;
}