#include <bits/stdc++.h>
 
#define loop(s, e, i) for (int i = s; i < e; ++i)
#define print(s) cout << s << endl;
#define DIV 1000000007
#define ll long long
using namespace std;
 
const int INF = 1e9+7;
 
ll ceildiv(ll a, ll b) { return (a+b-1)/b; } // 切り上げ
ll floordiv(ll a, ll b) { return a/b; } // 切り下げ
 
int show_matrix(vector<vector<int>> &dp) {
  loop(0, dp.size(), i) {
    loop(0, dp[i].size(), j) {
      cout << dp[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
 
ll power_mod(ll n, ll k, ll mod) {
  ll result = 1;
  while(k > 0) {
    if ((k & 1) == 1) result = (result * n) % mod;
    n = n*n % mod;
    k >>= 1;
  }
  return result;
}
 
/*
浮動小数点の入力
cout << fixed << setprecision(9) << endl;
*/
 
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
 
  ll N, M;
  cin >> N >> M;
 
  ll M2 = M * M;
  ll a = 1;
 
  ll b = power_mod(10, N, M2);
  print (b / M);
}
#include<bits/stdc++.h>
using namespace std;
#define D(x) cout<<__LINE__<<" : "<<#x<<" = "<<x<<endl



int t, n, _max, m,  x, y, tc;

int main() {
    //freopen("input.txt","r",stdin);
    cin>>n>>m;
    puts(m%n == 0 ? "Yes" : "No");
    return 0;
}
