    #include <bits/stdc++.h>
    using namespace std;
    #include <math.h>
    #include <iomanip>
    #include <cstdint>
    #include <string>
    #include <sstream>
    template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
    template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
    #define rep(i,n) for (int i = 0; i < (n); ++i)
    typedef long long ll;
    using P=pair<ll,ll>;
    const int INF=1001001001;
    const int mod=1e9+7;
    
    int main(){
        int n;
        cin>>n;
        vector<int>p(n);
        rep(i,n){
            cin>>p[i];
            p[i]--;
        }
        int i=0;
        vector<int>res;
        while(i<n-1){
            int j=i;
            while(j<n&&i!=p[j]){
                j++;
            }
            if(j!=n-1&&j==i){
                cout<<-1<<endl;
                return 0;
            }
            if(j==n){
                cout<<-1<<endl;
                return 0;
            }
            for(int k=j;k>i;k--){
                res.push_back(k);
                swap(p[k],p[k-1]);
            }
            i=j;
        }
        rep(i,n){
            if(p[i]!=i){
                cout<<-1<<endl;
                return 0;
            }
        }
        rep(i,res.size()){
            cout<<res[i]<<endl;
        }
        return 0;
    }
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

#define int             long long
#define ff              first
#define ss              second
#define pb              push_back
#define pii             pair<int,int>
#define sz(x)           (int)(x.size())
#define CR(x,n)          x.clear();x.resize(n)
#define all(x)          x.begin(),x.end()
#define repf(i,s,e)     for(int i=s;i<e;i++)
#define AUTO(c,v)         for(auto c:v)

template<typename T, typename T1>T smax(T &a, T1 b) {if (b > a)a = b; return a;}
template<typename T, typename T1>T smin(T &a, T1 b) {if (b < a)a = b; return a;}

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

#define nl '\n'
template <typename T, size_t N>
int SIZE(const T (&t)[N]) {
	return N;
}

template<typename T>
int SIZE(const T &t) {
	return t.size();
}

string to_string(const string s, int x1 = 0, int x2 = 1e9) {
	return '"' + ((x1 < s.size()) ? s.substr(x1, x2 - x1 + 1) : "") + '"';
}

string to_string(const char* s) {
	return to_string((string) s);
}

string to_string(const bool b) {
	return (b ? "true" : "false");
}

string to_string(const char c) {
	return string({c});
}

template<size_t N>
string to_string(const bitset<N> &b, int x1 = 0, int x2 = 1e9) {
	string t = "";
	for (int __iii__ = min(x1, SIZE(b)),  __jjj__ = min(x2, SIZE(b) - 1); __iii__ <= __jjj__; ++__iii__) {
		t += b[__iii__] + '0';
	}
	return '"' + t + '"';
}

template <typename A, typename... C>
string to_string(const A (&v), int x1 = 0, int x2 = 1e9, C... coords);

int l_v_l_v_l = 0, t_a_b_s = 0;

template <typename A, typename B>
string to_string(const pair<A, B> &p) {
	l_v_l_v_l++;
	string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
	l_v_l_v_l--;
	return res;
}

template <typename A, typename... C>
string to_string(const A (&v), int x1, int x2, C... coords) {
	int rnk = rank<A>::value;
	string tab(t_a_b_s, ' ');
	string res = "";
	bool first = true;
	if (l_v_l_v_l == 0) res += nl;
	res += tab + "[";
	x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v));
	auto l = begin(v);
	advance(l, x1);
	auto r = l;
	advance(r, (x2 - x1) + (x2 < SIZE(v)));
	for (auto e = l; e != r; e = next(e)) {
		if (!first) {
			res += ", ";
		}
		first = false;
		l_v_l_v_l++;
		if (e != l) {
			if (rnk > 1) {
				res += nl;
				t_a_b_s = l_v_l_v_l;
			};
		}
		else {
			t_a_b_s = 0;
		}
		res += to_string(*e, coords...);
		l_v_l_v_l--;
	}
	res += "]";
	if (l_v_l_v_l == 0) res += nl;
	return res;
}

void dbg() {;}
template<typename Heads, typename... Tails>
void dbg(Heads H, Tails... T) {
	cout << to_string(H) << " | ";
	dbg(T...);
}
#define dbg(...) cout << "[" << #__VA_ARGS__ << "]: "; dbg(__VA_ARGS__); cout << endl;

/* read */
template<typename... T>
void read(T&...args) {
	((cin >> args), ...);
}
template<class T>
void readArray(vector<T>& arr) {
	for (auto& c : arr) cin >> c;
}
/* print */
template<typename...T>
void print(T...args) {
	((cout << args << " "), ...);
	cout << nl;
}
template<class T>
void printArray(vector<T>& arr) {
	AUTO(c, arr) cout << c << " ";
	cout << nl;
}

const int INF = 1e18;

void solve() {
	int m, h;
	read(m, h);
	if (h % m == 0) {
		cout << "Yes\n";
	}
	else {
		cout << "No\n";
	}
}

int32_t main() {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	// if(fopen("input.txt", "r")){
	//     freopen("input.txt", "r", stdin),
	//     freopen("output.txt", "w", stdout);
	// }

	int t = 1;
	// cin>>t;
	for (int i = 1; i <= t; i++) {
		//cout<<"Case #"<<i<<": ";
		solve();
	}
}