#include<iostream>
#include<algorithm>
#include<cstring>
#include<string>
#include<cstdio>
#include<cctype>
#include<cmath>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<sstream>
#define mm(a,x) memset(a,x,sizeof(a))
#define maxn 100005
using namespace std;
typedef long long ll;
const int INF=0x3f3f3f3f;

void revd(int n,int d){
   
	int z[maxn],num=0,result=0;
	do{
   
		z[num++]=n%d;
		n/=d;
	}while(n!=0);
	
	bool ans=true;
	for(int i=0;i<num;i++)
	{
   
		if(z[i]!=z[num-1-i])
		{
   
			ans=false;
			break;
		}
	}
	if(ans) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	for(int i=num-1;i>=0;i--)
	{
   
		if(i!=num-1) cout<<" ";
		cout<<z[i];
	}
}

int main()
{
   
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
	int n,d;cin>>n>>d;
	revd(n,d);
}