stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

#define N 100005

using namespace std;



inline void rd(int &x){

	x=0;char ch=0;int w=0;

	while(!isdigit(ch)) ch=getchar(),w|=ch=='-';

	while( isdigit(ch)) x=(x<<1)+(x<<3)+(ch^48),ch=getchar();

	x=w?-x:x;

}

int n;

char s[N];

signed main(){

	scanf("%s",s+1);n=strlen(s+1);

	for(int i=1;i<=n;i++){

		if((s[i]=='p') and (s[n-i+1]!='q')) return puts("No"),0;

		if((s[i]=='b') and (s[n-i+1]!='d')) return puts("No"),0;

		if((s[i]=='q') and (s[n-i+1]!='p')) return puts("No"),0;

		if((s[i]=='d') and (s[n-i+1]!='b')) return puts("No"),0;

	} puts("Yes");

}


// Faster C++ solution for the same problem (measured speedup: 5.265327621095653x):
#include<cstdio>

#include<cstring>

using namespace std;

const int maxl=100010;

int l;

char str[maxl];

int main(){

	scanf("%s",&str);

	l=strlen(str);

	if(l%2!=0){

		printf("No\n");

		return 0;

	}

	for(int i=0;i<l/2;i++){

		if(str[i]=='b'&&str[l-i-1]!='d'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='d'&&str[l-i-1]!='b'){

		    printf("No\n");

		    return 0;

		}

		if(str[i]=='p'&&str[l-i-1]!='q'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='q'&&str[l-i-1]!='p'){

			printf("No\n");

		    return 0;

		}

	}

	printf("Yes\n");

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

char s1[100010],s2[100010];

int len;

int main()

{

	cin>>s1;

	for(int i=strlen(s1)-1; i>=0; i--)

	{

		s2[len++]=s1[i];

	}

	for(int i=0; i<strlen(s2); i++)

	{

		switch(s2[i])

		{

			case 'b':

			{

				s2[i]='d';

				break;

			}

			case 'd':

			{

				s2[i]='b';

				break;

			}

			case 'p':

			{

				s2[i]='q';

				break;

			}

			case 'q':

			{

				s2[i]='p';

				break;

			}

		}

	}

	if(strcmp(s1,s2)==0) cout<<"Yes"<<endl;

	else cout<<"No"<<endl;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.334437377551996x):
#include<cstdio>

#include<cstring>

using namespace std;

const int maxl=100010;

int l;

char str[maxl];

int main(){

	scanf("%s",&str);

	l=strlen(str);

	if(l%2!=0){

		printf("No\n");

		return 0;

	}

	for(int i=0;i<l/2;i++){

		if(str[i]=='b'&&str[l-i-1]!='d'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='d'&&str[l-i-1]!='b'){

		    printf("No\n");

		    return 0;

		}

		if(str[i]=='p'&&str[l-i-1]!='q'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='q'&&str[l-i-1]!='p'){

			printf("No\n");

		    return 0;

		}

	}

	printf("Yes\n");

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

string s1,s2;

int main(){

	cin>>s1;//getline(cin,s1);

	s2=s1;

	reverse(s2.begin(),s2.end());

	for(int i=0;i<s2.size();++i)

		s2[i]=='b'?s2[i]='d':s2[i]=='d'?s2[i]='b':s2[i]=='p'?s2[i]='q':s2[i]='p';

	if(s1==s2)	puts("Yes");

	else	puts("No");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.3112460409211675x):
#include<cstdio>

#include<cstring>

using namespace std;

const int maxl=100010;

int l;

char str[maxl];

int main(){

	scanf("%s",&str);

	l=strlen(str);

	if(l%2!=0){

		printf("No\n");

		return 0;

	}

	for(int i=0;i<l/2;i++){

		if(str[i]=='b'&&str[l-i-1]!='d'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='d'&&str[l-i-1]!='b'){

		    printf("No\n");

		    return 0;

		}

		if(str[i]=='p'&&str[l-i-1]!='q'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='q'&&str[l-i-1]!='p'){

			printf("No\n");

		    return 0;

		}

	}

	printf("Yes\n");

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define maxn 100100

using namespace std;



int len;



char s1[maxn],s2[maxn];



int main(){

	scanf("%s",s1);

	len=strlen(s1);

	for(int i=0;i<len;i++){

		if(s1[i]=='p') s2[i]='q';

		else if(s1[i]=='q') s2[i]='p';

		else if(s1[i]=='b') s2[i]='d';

		else if(s1[i]=='d') s2[i]='b';

	}

	for(int i=0;i<len;i++){

		if(s1[i]!=s2[len-1-i]){

			printf("No");

			return 0;

		}

	}

	printf("Yes");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.2694066672500774x):
#include<cstdio>

#include<cstring>

using namespace std;

const int maxl=100010;

int l;

char str[maxl];

int main(){

	scanf("%s",&str);

	l=strlen(str);

	if(l%2!=0){

		printf("No\n");

		return 0;

	}

	for(int i=0;i<l/2;i++){

		if(str[i]=='b'&&str[l-i-1]!='d'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='d'&&str[l-i-1]!='b'){

		    printf("No\n");

		    return 0;

		}

		if(str[i]=='p'&&str[l-i-1]!='q'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='q'&&str[l-i-1]!='p'){

			printf("No\n");

		    return 0;

		}

	}

	printf("Yes\n");

	return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <iostream>

#include <algorithm>

#include <string>

using namespace std;

string s;

int main()

{

	cin>>s;

	int len=s.size();

	if(len%2==1)

	{

		cout<<"No"<<endl;

		return 0;

	}

	//cout<<s<<endl;

	for(int i=0;i<len/2;i++)

	{

		if((s[i]=='p'&&s[len-i-1]=='q')||(s[i]=='q'&&s[len-i-1]=='p')||(s[i]=='d'&&s[len-i-1]=='b')||(s[i]=='b'&&s[len-i-1]=='d'))

		{

			continue;

		}

		else

		{

			cout<<"No"<<endl;

			return 0;

		}

	} 

	cout<<"Yes"<<endl;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.333366546338768x):
#include<cstdio>

#include<cstring>

using namespace std;

const int maxl=100010;

int l;

char str[maxl];

int main(){

	scanf("%s",&str);

	l=strlen(str);

	if(l%2!=0){

		printf("No\n");

		return 0;

	}

	for(int i=0;i<l/2;i++){

		if(str[i]=='b'&&str[l-i-1]!='d'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='d'&&str[l-i-1]!='b'){

		    printf("No\n");

		    return 0;

		}

		if(str[i]=='p'&&str[l-i-1]!='q'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='q'&&str[l-i-1]!='p'){

			printf("No\n");

		    return 0;

		}

	}

	printf("Yes\n");

	return 0;

}
// Slower C++ solution:
# include <bits/stdc++.h>

using namespace std;

string s,tmp;

int main()

{

	ios::sync_with_stdio(false);

	cin.tie(0);

	cout.tie(0);

	cin>>s;

	tmp=s;

	reverse(tmp.begin(),tmp.end());

	int Len=tmp.size();

	for(register int i=0;i<Len;++i)

	{

		switch(tmp[i])

		{

			case 'b':tmp[i]='d';break;

			case 'd':tmp[i]='b';break;

			case 'p':tmp[i]='q';break;

			case 'q':tmp[i]='p';break;

		}

	}

	if(tmp==s)

	{

		printf("Yes");

	}

	else

	{

		printf("No");

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.399117142918956x):
#include<cstdio>

#include<cstring>

using namespace std;

const int maxl=100010;

int l;

char str[maxl];

int main(){

	scanf("%s",&str);

	l=strlen(str);

	if(l%2!=0){

		printf("No\n");

		return 0;

	}

	for(int i=0;i<l/2;i++){

		if(str[i]=='b'&&str[l-i-1]!='d'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='d'&&str[l-i-1]!='b'){

		    printf("No\n");

		    return 0;

		}

		if(str[i]=='p'&&str[l-i-1]!='q'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='q'&&str[l-i-1]!='p'){

			printf("No\n");

		    return 0;

		}

	}

	printf("Yes\n");

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

	string s;

	cin>>s;

	string n=s;	/*PS!!!将s的值赋给s2,为了后期的判断做一个参照*/

	reverse(s.begin(),s.end());	/*倒置字符串*/

	for(int i=0;i<s.size();++i)	/*遍历字符串（可用s.length()）*/

	{

		if(s[i]=='b') s[i]='d';

		else if(s[i]=='d') s[i]='b';

		else if(s[i]=='p') s[i]='q';

		else if(s[i]=='q') s[i]='p';

	}

	if(s==n) cout<<"Yes"; 	/*直接使用参照数据进行判断*/

	else  cout<<"No";  		

}

// Faster C++ solution for the same problem (measured speedup: 5.362037804285466x):
#include<cstdio>

#include<cstring>

using namespace std;

const int maxl=100010;

int l;

char str[maxl];

int main(){

	scanf("%s",&str);

	l=strlen(str);

	if(l%2!=0){

		printf("No\n");

		return 0;

	}

	for(int i=0;i<l/2;i++){

		if(str[i]=='b'&&str[l-i-1]!='d'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='d'&&str[l-i-1]!='b'){

		    printf("No\n");

		    return 0;

		}

		if(str[i]=='p'&&str[l-i-1]!='q'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='q'&&str[l-i-1]!='p'){

			printf("No\n");

		    return 0;

		}

	}

	printf("Yes\n");

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



#define scanf cin

#define printf cout



int main()

{

	std::ios::sync_with_stdio(false);

    string ori;

    scanf>>ori;

    string b=ori;

    reverse(ori.begin(),ori.end());

    for(int i=0;i<ori.size();++i)

    {

        if(ori[i]=='b') ori[i]='d';

        else if(ori[i]=='d') ori[i]='b';

        else if(ori[i]=='p') ori[i]='q';

        else if(ori[i]=='q') ori[i]='p';

    }

    if(ori==b) printf<<"Yes"<<endl;

    else printf<<"No"<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.1108367508213495x):
#include<cstdio>

#include<string>

using namespace std;

char a[100005];

string s,s2,s3;

int main()

{

	scanf("%s",&a);

	s=a;

	for (int j=0;j<=s.size()-1;j++)

	{

		if(s[j]=='b')

		s2+='d';

		if(s[j]=='d')

		s2+='b';

		if(s[j]=='p')

		s2+='q';

		if(s[j]=='q')

		s2+='p';

	}

	for (int j=s2.size()-1;j>=0;j--)

	{

		s3+=s2[j];

	}

	if(s3==s)

	printf("Yes");

	else printf("No");

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

string s;

int main(){

    cin>>s;

    int c=s.size();

    if(c%2!=0){

        printf("No");

        return 0;

    }

    for(int i=0;i<c/2;i++){

        short t=abs(s[i]-s[c-i-1]);

        if(t!=1&&t!=2){ 

            printf("No\n"); 

            return 0;

        }

    }

    printf("Yes\n"); 

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.264520828362239x):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 s[1] 开始的

    for(int l = strlen(s+1), i = 1; i <= (l>>1) + 1; ++i)

    {

        if(get[s[i]]^((get[s[l-i+1]]+2)%4)) return printf("No\n"),0;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

string a;

char b[100003];

int r=1;

int main(){

    cin>>a;

    int f=a.size()-1;

    for(int i=0;i<=f;i++)

       b[f-i]=a[i];

    for(int i=0;i<=f;i++){

        if(b[i]=='b')b[i]='d';

        else if(b[i]=='d')b[i]='b';

        else if(b[i]=='p')b[i]='q';

        else b[i]='p';

        if(b[i]!=a[i]){

           r=0;

           break;

        }

    }

    if(r==0)cout<<"No";

    else cout<<"Yes";

}

// Faster C++ solution for the same problem (measured speedup: 5.3182468623485x):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 s[1] 开始的

    for(int l = strlen(s+1), i = 1; i <= (l>>1) + 1; ++i)

    {

        if(get[s[i]]^((get[s[l-i+1]]+2)%4)) return printf("No\n"),0;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    string a;

    cin>>a;

    string b=a;

    reverse(a.begin(),a.end());

    for(int i=0;i<a.size();++i)

    {

        if(a[i]=='b') a[i]='d';

        else if(a[i]=='d') a[i]='b';

        else if(a[i]=='p') a[i]='q';

        else if(a[i]=='q') a[i]='p';

    }

    if(a==b) cout<<"Yes"<<endl;

    else cout<<"No"<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.373008834860594x):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 s[1] 开始的

    for(int l = strlen(s+1), i = 1; i <= (l>>1) + 1; ++i)

    {

        if(get[s[i]]^((get[s[l-i+1]]+2)%4)) return printf("No\n"),0;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

string s,a;

int main()

{

    cin>>s;

    for(int i=s.size()-1;i>=0;i--)

    {

    	

    	if(s[i]=='b')

    	a=a+'d';

    	if(s[i]=='d')

    	a=a+'b';

    	if(s[i]=='p')

    	a=a+'q';

    	if(s[i]=='q')

    	a=a+'p';

	}

	if(a==s)

	cout<<"Yes";

	else

	cout<<"No";

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.368120548589383x):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 s[1] 开始的

    for(int l = strlen(s+1), i = 1; i <= (l>>1) + 1; ++i)

    {

        if(get[s[i]]^((get[s[l-i+1]]+2)%4)) return printf("No\n"),0;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



#define scanf cin

#define printf cout



int main()

{

	std::ios::sync_with_stdio(false);

    string ori;

    scanf>>ori;

    string b=ori;

    reverse(ori.begin(),ori.end());

    for(int i=0;i<ori.size();++i)

    {

        if(ori[i]=='b') ori[i]='d';

        else if(ori[i]=='d') ori[i]='b';

        else if(ori[i]=='p') ori[i]='q';

        else if(ori[i]=='q') ori[i]='p';

    }

    if(ori==b) printf<<"Yes"<<endl;

    else printf<<"No"<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.449208858232378x):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 s[1] 开始的

    for(int l = strlen(s+1), i = 1; i <= (l>>1) + 1; ++i)

    {

        if(get[s[i]]^((get[s[l-i+1]]+2)%4)) return printf("No\n"),0;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

    string a;

    cin>>a;

    string b=a;

    reverse(a.begin(),a.end());

    for(int i=0;i<a.size();++i)

    {

        if(a[i]=='b') a[i]='d';

        else if(a[i]=='d') a[i]='b';

        else if(a[i]=='p') a[i]='q';

        else if(a[i]=='q') a[i]='p';

    }

    if(a==b) cout<<"Yes";

    else cout<<"No";

}


// Faster C++ solution for the same problem (measured speedup: 5.360757793043199x):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 s[1] 开始的

    for(int l = strlen(s+1), i = 1; i <= (l>>1) + 1; ++i)

    {

        if(get[s[i]]^((get[s[l-i+1]]+2)%4)) return printf("No\n"),0;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

string s,p;

int m,n,j,k,l,sum,ans,r;

string fz(string h)

{

	char t,y;

	int len=h.size();

	for(int i=0; i<len/2; i++)

	{

		t=h[i];

		y=h[len-i-1];

		h[i]=y;

		h[len-i-1]=t;

	}

	return h;

}

int main()

{

	getline(cin,s);

	p=fz(s);

	l=p.size();

	for(int i=0; i<l; i++)

	{

		if(p[i]=='b')p[i]='d';

		else if(p[i]=='d')p[i]='b';

		else if(p[i]=='p')p[i]='q';

		else if(p[i]=='q')p[i]='p';

	}

	if(p==s)printf("Yes\n");

	else printf("No\n");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.348712986935676x):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 s[1] 开始的

    for(int l = strlen(s+1), i = 1; i <= (l>>1) + 1; ++i)

    {

        if(get[s[i]]^((get[s[l-i+1]]+2)%4)) return printf("No\n"),0;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

string e,m;

int l;

int main()

{

	cin>>e;

	m=e;

	l=e.length();

	if(l%2==0)

	{

		for(int i=0;i<l/2;i++)//双数长度 

		{

			swap(e[i],e[l-i-1]);

		}

	}

	else

	{

		for(int i=0;i<l/2;i++)//单数长度 

		{

			swap(e[i],e[l-i-1]);

		}

	}

	//改b为d，改d为b，改p为q，改q为p（不要搞错对应关系）

	for(int i=0;i<l;i++)

	{

		switch(e[i])

		{

			case 'b':

			{

				e[i]='d';

				break;

			}

			case 'd':

			{

				e[i]='b';

				break;

			}

			case 'p':

			{

				e[i]='q';

				break;

			}

			case 'q':

			{

				e[i]='p';

				break;

			}

		}

	}

	if(e==m)

	{

		printf("Yes\n");

	}

	else

	{

		printf("No\n");

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.314963840719033x):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 s[1] 开始的

    for(int l = strlen(s+1), i = 1; i <= (l>>1) + 1; ++i)

    {

        if(get[s[i]]^((get[s[l-i+1]]+2)%4)) return printf("No\n"),0;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define N 100005

using namespace std;



inline void rd(int &x){

	x=0;char ch=0;int w=0;

	while(!isdigit(ch)) ch=getchar(),w|=ch=='-';

	while( isdigit(ch)) x=(x<<1)+(x<<3)+(ch^48),ch=getchar();

	x=w?-x:x;

}

int n;

char s[N];

signed main(){

	scanf("%s",s+1);n=strlen(s+1);

	for(int i=1;i<=n;i++){

		if((s[i]=='p') and (s[n-i+1]!='q')) return puts("No"),0;

		if((s[i]=='b') and (s[n-i+1]!='d')) return puts("No"),0;

		if((s[i]=='q') and (s[n-i+1]!='p')) return puts("No"),0;

		if((s[i]=='d') and (s[n-i+1]!='b')) return puts("No"),0;

	} puts("Yes");

}


// Faster C++ solution for the same problem (measured speedup: 5.2640706962481945x):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 s[1] 开始的

    for(int l = strlen(s+1), i = 1; i <= (l>>1) + 1; ++i)

    {

        if(get[s[i]]^((get[s[l-i+1]]+2)%4)) return printf("No\n"),0;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

char s1[100010],s2[100010];

int len;

int main()

{

	cin>>s1;

	for(int i=strlen(s1)-1; i>=0; i--)

	{

		s2[len++]=s1[i];

	}

	for(int i=0; i<strlen(s2); i++)

	{

		switch(s2[i])

		{

			case 'b':

			{

				s2[i]='d';

				break;

			}

			case 'd':

			{

				s2[i]='b';

				break;

			}

			case 'p':

			{

				s2[i]='q';

				break;

			}

			case 'q':

			{

				s2[i]='p';

				break;

			}

		}

	}

	if(strcmp(s1,s2)==0) cout<<"Yes"<<endl;

	else cout<<"No"<<endl;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.333163955009361x):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 s[1] 开始的

    for(int l = strlen(s+1), i = 1; i <= (l>>1) + 1; ++i)

    {

        if(get[s[i]]^((get[s[l-i+1]]+2)%4)) return printf("No\n"),0;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

string s1,s2;

int main(){

	cin>>s1;//getline(cin,s1);

	s2=s1;

	reverse(s2.begin(),s2.end());

	for(int i=0;i<s2.size();++i)

		s2[i]=='b'?s2[i]='d':s2[i]=='d'?s2[i]='b':s2[i]=='p'?s2[i]='q':s2[i]='p';

	if(s1==s2)	puts("Yes");

	else	puts("No");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.309978154552035x):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 s[1] 开始的

    for(int l = strlen(s+1), i = 1; i <= (l>>1) + 1; ++i)

    {

        if(get[s[i]]^((get[s[l-i+1]]+2)%4)) return printf("No\n"),0;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define maxn 100100

using namespace std;



int len;



char s1[maxn],s2[maxn];



int main(){

	scanf("%s",s1);

	len=strlen(s1);

	for(int i=0;i<len;i++){

		if(s1[i]=='p') s2[i]='q';

		else if(s1[i]=='q') s2[i]='p';

		else if(s1[i]=='b') s2[i]='d';

		else if(s1[i]=='d') s2[i]='b';

	}

	for(int i=0;i<len;i++){

		if(s1[i]!=s2[len-1-i]){

			printf("No");

			return 0;

		}

	}

	printf("Yes");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.268148768663692x):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 s[1] 开始的

    for(int l = strlen(s+1), i = 1; i <= (l>>1) + 1; ++i)

    {

        if(get[s[i]]^((get[s[l-i+1]]+2)%4)) return printf("No\n"),0;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}
// Slower C++ solution:
#include <cstdio>

#include <iostream>

#include <algorithm>

#include <string>

using namespace std;

string s;

int main()

{

	cin>>s;

	int len=s.size();

	if(len%2==1)

	{

		cout<<"No"<<endl;

		return 0;

	}

	//cout<<s<<endl;

	for(int i=0;i<len/2;i++)

	{

		if((s[i]=='p'&&s[len-i-1]=='q')||(s[i]=='q'&&s[len-i-1]=='p')||(s[i]=='d'&&s[len-i-1]=='b')||(s[i]=='b'&&s[len-i-1]=='d'))

		{

			continue;

		}

		else

		{

			cout<<"No"<<endl;

			return 0;

		}

	} 

	cout<<"Yes"<<endl;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.33209337942208x):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 s[1] 开始的

    for(int l = strlen(s+1), i = 1; i <= (l>>1) + 1; ++i)

    {

        if(get[s[i]]^((get[s[l-i+1]]+2)%4)) return printf("No\n"),0;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}
// Slower C++ solution:
# include <bits/stdc++.h>

using namespace std;

string s,tmp;

int main()

{

	ios::sync_with_stdio(false);

	cin.tie(0);

	cout.tie(0);

	cin>>s;

	tmp=s;

	reverse(tmp.begin(),tmp.end());

	int Len=tmp.size();

	for(register int i=0;i<Len;++i)

	{

		switch(tmp[i])

		{

			case 'b':tmp[i]='d';break;

			case 'd':tmp[i]='b';break;

			case 'p':tmp[i]='q';break;

			case 'q':tmp[i]='p';break;

		}

	}

	if(tmp==s)

	{

		printf("Yes");

	}

	else

	{

		printf("No");

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.397828280196703x):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 s[1] 开始的

    for(int l = strlen(s+1), i = 1; i <= (l>>1) + 1; ++i)

    {

        if(get[s[i]]^((get[s[l-i+1]]+2)%4)) return printf("No\n"),0;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}