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

using namespace std;

string a,b;

int main()

{

    cin>>a;

    b=a;

    int l=a.size();

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

    for(int i=0;i<l;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) printf("Yes\n");

    else printf("No\n");

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.314162488203154x):
#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);

    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;

    } 

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

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

using namespace std;

int main(){

    string aaa;

    cin>>aaa;

    string b=aaa;

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

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

    {

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

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

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

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

    }

    if(aaa==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);

    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;

    } 

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

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

using namespace std;



string f,p;

int l,i;

int main()

{

	cin>>f;

	p=f;

	l=f.size();

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

	{

		p[i]=f[l-i-1];

	}

	for(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==f)cout<<"Yes"<<endl;

	  else cout<<"No"<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.337823492977606x):
#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);

    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;

    } 

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

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

using namespace std;

int main()

{

	string s;

	cin>>s;

	string b=s;

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

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

	{

		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==b) 

	cout<<"Yes"<<"\n";

	else

	cout<<"No"<<"\n";

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.3623955692223095x):
#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);

    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;

    } 

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

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

using namespace std;

#define ll long long

string s,t;

int main() 

{

	cin>>s;t=s;

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

	for(int i=0;i<s.length();i++)

	{

		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==t) cout<<"Yes"<<endl;

	else cout<<"No"<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.338554493640065x):
#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);

    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;

    } 

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

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

using namespace std;

string s,g;

char hs(char c){

    if(c=='b') return 'd';

    if(c=='d') return 'b';

    if(c=='p') return 'q';

    return 'p';

}

int i,j,k,l,m,n,b;

int main(){

    cin>>s;

    for(i=0;i<s.size();i++){

        g+=hs(s[s.size()-i-1]);

    }

    if(s==g) cout<<"Yes";

    else cout<<"No";

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.319952056559059x):
#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);

    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;

    } 

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

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

using namespace std;

int main()

{

    string s;

    cin>>s;

    string t=s;

    int a=s.length();

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

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

    {

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

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

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

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

    }

    if(s==t) cout<<"Yes\n";

    else cout<<"No\n";

}

// Faster C++ solution for the same problem (measured speedup: 5.360966663205455x):
#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);

    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;

    } 

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

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

using namespace std;



string s,r;



int main() {

	cin>>s;

	r=s;

	long long len=s.length();

	//cout<<len<<endl;

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

		r[i+1]=s[len-i-1];

	}

	for(long long i=len;i>=1;i--) {

		s[i]=s[i-1];

	}

	

	/*

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

		cout<<r[i]<<" ";

	} 

	cout<<endl;

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

		cout<<s[i]<<" ";

	}

	cout<<endl;

	*/

	for(long long i=1;i<=len;i++) {

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

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

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

		else r[i]='p';

	}

	for(long long i=1;i<=len;i++) {

		//cout<<r[i]<<" "<<s[i]<<endl;

		if(r[i]!=s[i]) {

			cout<<"No"<<endl;

			return 0;

		}

	}

	cout<<"Yes"<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.3376274657707174x):
#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);

    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;

    } 

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

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

using namespace std;

int main()

{

	string a,b;

	cin>>a;

	int l=a.size();

	b=a;

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

		switch(b[i])

		{

			case 'b':

				b[i]='d';

				break;

			case 'd':

				b[i]='b';

				break;

			case 'q':

				b[i]='p';

				break;

			case 'p':

				b[i]='q';

				break;

		}

	

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

		if(a[i]!=b[l-1-i])

		{

			cout<<"No";

			return 0;

		}

	

	cout<<"Yes";

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.364829324233177x):
#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);

    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;

    } 

    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);

    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;

    } 

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

}
// Slower C++ solution:
// luogu-judger-enable-o2

#include<bits/stdc++.h>

using namespace std;

char s[100009];

int main()

{

	scanf("%s",s);

	int l=strlen(s);

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

	{

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

		{

			printf("No");

			return 0; 

		}

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

		{

			printf("No");

			return 0; 

		}

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

		{

			printf("No");

			return 0; 

		}

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

		{

			printf("No");

			return 0; 

		}

	}

	printf("Yes");

}	

// Faster C++ solution for the same problem (measured speedup: 5.269104416265749x):
#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);

    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;

    } 

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

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

#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

char s1[100100],s2[100100];



int main(){

	int cnt=0;

	cin>>s1;

	int len=strlen(s1);

	for(int i=len-1;i>=0;i--){

		s2[cnt]=s1[i];

		if(s2[cnt]=='q')

			s2[cnt]='p';

		else if(s2[cnt]=='p')

			s2[cnt]='q';

		else if(s2[cnt]=='b')

			s2[cnt]='d';

		else if(s2[cnt]=='d')

			s2[cnt]='b';

		cnt++;

	}

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

		if(s1[i]!=s2[i]){

			printf("No\n");

			return 0;

		}

	}

	printf("Yes\n");

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 5.307361873902745x):
#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);

    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;

    } 

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

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

#include <iostream>

#include <cstring>

using namespace std;

string s;



string rev(string ori){

	string ss=ori;

	int j=ori.length()-1;

	for (int i=0;i<s.length();i++){

		ss[i]=ori[j];j--;

	}

	return ss;

}



int main(){

	cin>>s;

	string s2=s;

	string s3=rev(s);

	for (int i=0;i<s.length();i++){

		if(s2[i]=='b') {s2[i]='d';continue;}

		if(s2[i]=='d') {s2[i]='b';continue;}

		if(s2[i]=='p') {s2[i]='q';continue;}

		if(s2[i]=='q') {s2[i]='p';continue;}

	}

	string s4=rev(s2);

	//cout<<s2<<endl<<s3<<endl<<s4<<endl;

	if(s2==s||s3==s||s4==s) cout<<"Yes";

	else cout<<"No";

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.3742295905547754x):
#include<stdio.h>

#define mkp make_pair

#define getbit(a) (1<<(a-1))

#define lowbit(a) ((a)&(-(a)))

#define max(a,b) ((a)>(b)?(a):(b))

#define min(a,b) ((a)<(b)?(a):(b))

#define readbit(a,b) ((a>>(b-1))&1)

#define filein(a) freopen(a,"r",stdin)

#define fileout(a) freopen(a,"w",stdout)

#define plp(a,b,c) for(register int a=b;a<=c;a++)

#define rlp(a,b,c) for(register int a=b;a<=c;a++)

//get

inline void get(int &x) {

	static char c = getchar();x = 0;static int fh = 1;

	while(c < '0' || c > '9')fh=(c=='-')?-1:1,c = getchar();

	while(c <= '9' && c >= '0') x = x*10+c-48, c = getchar();

	x=x*fh;

}

inline void get(long long &x) {

	static char c = getchar();x = 0;static int fh = 1;

	while(c < '0' || c > '9')fh=(c=='-')?-1:1,c = getchar();

	while(c <= '9' && c >= '0') x = x*10+c-48, c = getchar();

	x=x*fh;

}

//get

//putll

inline void putll(long long x) {

	if(x==0) {putchar(48);return;}

	if(x<0){putchar('-');x=-x;}

	static int num = 0;static char c[25];

	while(x) c[++num] = (x%10)+48, x /= 10;

	while(num) putchar(c[num--]);

}

//putll

/*

//Gragh

const int maxv=20005;const int maxe=20005;

static int vet[maxe],vis[maxv],head[maxv],next[maxe],edgenum;

static int val[maxe];

//Gragh

//add

inline void add(int u,int v) {

    vet[++edgenum]=v;

    next[edgenum]=head[u];

    head[u]=edgenum;

}

inline void add(int u,int v,int value){

    vet[++edgenum]=v;

    val[edgenum]=value;

    next[edgenum]=head[u];

    head[u]=edgenum;

}

//add

*/

//正文从这里开始，以上都是MTL

char st[100005];

char map[256];

#include<cstring>

int len;

int main(){

	scanf("%s",st);

	len=strlen(st);

	if(len&1){

		puts("No");

		return 0;

	}

	map['d']='b';map['b']='d';map['p']='q';map['q']='p';

	for(register int i=0;i<(len>>1);i++)

		if(map[st[i]]!=st[len-i-1]){

			puts("No");

			return 0;

		}

	puts("Yes");

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

using namespace std;

char str[100010];

int main() {

	scanf("%s",&str);

	int len=strlen(str);

	if(len%2!=0) {

		printf("No");

		return 0;

	}

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

		int r=abs(str[i]-str[len-i-1]);

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

			printf("No");

			return 0;

		}

	}

	printf("Yes");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.273904680089408x):
#include<stdio.h>

#define mkp make_pair

#define getbit(a) (1<<(a-1))

#define lowbit(a) ((a)&(-(a)))

#define max(a,b) ((a)>(b)?(a):(b))

#define min(a,b) ((a)<(b)?(a):(b))

#define readbit(a,b) ((a>>(b-1))&1)

#define filein(a) freopen(a,"r",stdin)

#define fileout(a) freopen(a,"w",stdout)

#define plp(a,b,c) for(register int a=b;a<=c;a++)

#define rlp(a,b,c) for(register int a=b;a<=c;a++)

//get

inline void get(int &x) {

	static char c = getchar();x = 0;static int fh = 1;

	while(c < '0' || c > '9')fh=(c=='-')?-1:1,c = getchar();

	while(c <= '9' && c >= '0') x = x*10+c-48, c = getchar();

	x=x*fh;

}

inline void get(long long &x) {

	static char c = getchar();x = 0;static int fh = 1;

	while(c < '0' || c > '9')fh=(c=='-')?-1:1,c = getchar();

	while(c <= '9' && c >= '0') x = x*10+c-48, c = getchar();

	x=x*fh;

}

//get

//putll

inline void putll(long long x) {

	if(x==0) {putchar(48);return;}

	if(x<0){putchar('-');x=-x;}

	static int num = 0;static char c[25];

	while(x) c[++num] = (x%10)+48, x /= 10;

	while(num) putchar(c[num--]);

}

//putll

/*

//Gragh

const int maxv=20005;const int maxe=20005;

static int vet[maxe],vis[maxv],head[maxv],next[maxe],edgenum;

static int val[maxe];

//Gragh

//add

inline void add(int u,int v) {

    vet[++edgenum]=v;

    next[edgenum]=head[u];

    head[u]=edgenum;

}

inline void add(int u,int v,int value){

    vet[++edgenum]=v;

    val[edgenum]=value;

    next[edgenum]=head[u];

    head[u]=edgenum;

}

//add

*/

//正文从这里开始，以上都是MTL

char st[100005];

char map[256];

#include<cstring>

int len;

int main(){

	scanf("%s",st);

	len=strlen(st);

	if(len&1){

		puts("No");

		return 0;

	}

	map['d']='b';map['b']='d';map['p']='q';map['q']='p';

	for(register int i=0;i<(len>>1);i++)

		if(map[st[i]]!=st[len-i-1]){

			puts("No");

			return 0;

		}

	puts("Yes");

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

#include <iostream>

#include <cstring>

using namespace std;

string s;



string rev(string ori){

	string ss=ori;

	int j=ori.length()-1;

	for (int i=0;i<s.length();i++){

		ss[i]=ori[j];j--;

	}

	return ss;

}



int main(){

	cin>>s;

	string s2=s;

	string s3=rev(s);

	for (int i=0;i<s.length();i++){

		if(s2[i]=='b') {s2[i]='d';continue;}

		if(s2[i]=='d') {s2[i]='b';continue;}

		if(s2[i]=='p') {s2[i]='q';continue;}

		if(s2[i]=='q') {s2[i]='p';continue;}

	}

	string s4=rev(s2);

	//cout<<s2<<endl<<s3<<endl<<s4<<endl;

	if(s2==s||s3==s||s4==s) cout<<"Yes";

	else cout<<"No";

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.373923980673361x):
//zdj

#include<cstdio>

#include<cstring>

char s[100010],c[120];

signed main()

{

	scanf("%s",s),c[98]=0,c[100]=2,c[112]=1,c[113]=3;int l(strlen(s)),ll(l>>1);

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

		if(c[s[i]]^((c[s[l-i-1]]+2)%4))

			return puts("No"),0;

	return puts("Yes"),0;

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

using namespace std;

char str[100010];

int main() {

	scanf("%s",&str);

	int len=strlen(str);

	if(len%2!=0) {

		printf("No");

		return 0;

	}

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

		int r=abs(str[i]-str[len-i-1]);

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

			printf("No");

			return 0;

		}

	}

	printf("Yes");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.273604775264593x):
//zdj

#include<cstdio>

#include<cstring>

char s[100010],c[120];

signed main()

{

	scanf("%s",s),c[98]=0,c[100]=2,c[112]=1,c[113]=3;int l(strlen(s)),ll(l>>1);

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

		if(c[s[i]]^((c[s[l-i-1]]+2)%4))

			return puts("No"),0;

	return puts("Yes"),0;

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

#include<iostream>

#include<cstring>

#include<stack>

using namespace std;

stack<char>s;

string a;

int main(){

	cin>>a;

	int n=a.size();

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

		s.push(a[i]);

	}

	long long ans=1;

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

		char top=s.top();

		if(top=='b')

			top='d';

		else

			if(top=='d')

				top='b';

		else

			if(top=='p')

				top='q';

		else

			if(top=='q')

				top='p';

		if(top==a[i]){

			ans=1;

			s.pop();

		}

		else{

			ans=0;

			break;

		}

	}

	if(ans==0)

		printf("No");

	else

		printf("Yes");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.3630131956991045x):
//zdj

#include<cstdio>

#include<cstring>

char s[100010],c[120];

signed main()

{

	scanf("%s",s),c[98]=0,c[100]=2,c[112]=1,c[113]=3;int l(strlen(s)),ll(l>>1);

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

		if(c[s[i]]^((c[s[l-i-1]]+2)%4))

			return puts("No"),0;

	return puts("Yes"),0;

}
// 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.2717591996736255x):
//zdj

#include<cstdio>

#include<cstring>

char s[100010],c[120];

signed main()

{

	scanf("%s",s),c[98]=0,c[100]=2,c[112]=1,c[113]=3;int l(strlen(s)),ll(l>>1);

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

		if(c[s[i]]^((c[s[l-i-1]]+2)%4))

			return puts("No"),0;

	return puts("Yes"),0;

}
// 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.2715097335624295x):
//zdj

#include<cstdio>

#include<cstring>

char s[100010],c[120];

signed main()

{

	scanf("%s",s),c[98]=0,c[100]=2,c[112]=1,c[113]=3;int l(strlen(s)),ll(l>>1);

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

		if(c[s[i]]^((c[s[l-i-1]]+2)%4))

			return puts("No"),0;

	return puts("Yes"),0;

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

using namespace std;

char a[100005],b[100005];

int main()

{

	cin>>a;

	for(int i=0;i<strlen(a);i++){

		b[i]=a[strlen(a)-i-1];

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

		b[i]='d';

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

		b[i]='b';

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

		b[i]='q';

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

		b[i]='p';

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

			cout<<"No";

			return 0;

		}

	}

	cout<<"Yes";

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.28336285114165x):
//zdj

#include<cstdio>

#include<cstring>

char s[100010],c[120];

signed main()

{

	scanf("%s",s),c[98]=0,c[100]=2,c[112]=1,c[113]=3;int l(strlen(s)),ll(l>>1);

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

		if(c[s[i]]^((c[s[l-i-1]]+2)%4))

			return puts("No"),0;

	return puts("Yes"),0;

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

#include<iomanip>

#include<cmath>

#include<cstring>

#include<cstdio>

#include<queue>

#include<algorithm>

using namespace std;

char s[100005];

int ma[205];

int main()

{

	scanf("%s",s);

	int len=strlen(s);

	ma['p']=1,ma['q']=4,ma['b']=2,ma['d']=3;

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

	{

		if(ma[s[i]]+ma[s[len-i-1]]!=5)

		{

			printf("No");

			return 0;

		}

	}

	printf("Yes");

}

// Faster C++ solution for the same problem (measured speedup: 5.276082349656612x):
//zdj

#include<cstdio>

#include<cstring>

char s[100010],c[120];

signed main()

{

	scanf("%s",s),c[98]=0,c[100]=2,c[112]=1,c[113]=3;int l(strlen(s)),ll(l>>1);

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

		if(c[s[i]]^((c[s[l-i-1]]+2)%4))

			return puts("No"),0;

	return puts("Yes"),0;

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

#include<iostream>

#include<cstring>

#include<stack>

using namespace std;

stack<char>s;

string a;

int main(){

    cin>>a;

    int n=a.size();

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

        s.push(a[i]);

    }

    bool ju=1;

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

        char top=s.top();

        if(top=='b') top='d';

        else if(top=='d') top='b';

        else if(top=='p') top='q';

        else if(top=='q') top='p';

        if(top==a[i]) {

            ju=1;

            s.pop();

        }

        else {

            ju=0;

            break;

        }

    }

    if(ju==0) printf("No");

    else printf("Yes");

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.364356586595549x):
//zdj

#include<cstdio>

#include<cstring>

char s[100010],c[120];

signed main()

{

	scanf("%s",s),c[98]=0,c[100]=2,c[112]=1,c[113]=3;int l(strlen(s)),ll(l>>1);

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

		if(c[s[i]]^((c[s[l-i-1]]+2)%4))

			return puts("No"),0;

	return puts("Yes"),0;

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

using namespace std;

string s;

int main()

{

	int l,i,j;

	cin>>s;

	l=s.size();

	if(l%2)

	{

		cout<<"No";

		return 0;

	}

	for(i=0,j=l-1;i<j;i++,j--)

	{

		if(s[i]=='b'&&s[j]!='d')

		{

			cout<<"No";

			return 0;

		}

		else

		{

			if(s[i]=='d'&&s[j]!='b')

			{

				cout<<"No";

				return 0;

			}

			else

			{

				if(s[i]=='p'&&s[j]!='q')

				{

					cout<<"No";

					return 0;

				}

				else

				{

					if(s[i]=='q'&&s[j]!='p')

					{

						cout<<"No";

						return 0;

					}

				}

			}

		}

	}

	cout<<"Yes";

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.3255367879253726x):
//zdj

#include<cstdio>

#include<cstring>

char s[100010],c[120];

signed main()

{

	scanf("%s",s),c[98]=0,c[100]=2,c[112]=1,c[113]=3;int l(strlen(s)),ll(l>>1);

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

		if(c[s[i]]^((c[s[l-i-1]]+2)%4))

			return puts("No"),0;

	return puts("Yes"),0;

}