stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <cstdio>

#include <cstring>

#include <algorithm>

using namespace std;

char s[100001],ss[100001];

int main(){

	scanf("%s",s);

	memcpy(ss,s,sizeof(s));

	int n=strlen(s);

	reverse(s,s+n);

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

		switch(s[i]){

			case 'd':

				s[i]='b';

				break;

			case 'b':

				s[i]='d';

				break;

			case 'p':

				s[i]='q';

				break;

			case 'q':

				s[i]='p';

				break;

		}

	puts(strcmp(ss,s)?"No":"Yes");

	return 0;

}

// Optimized solution to the same problem (faster):
#include <algorithm>

#include <cstdlib>

#include <cstring>

#include <cstdio>

#include <string>

#include <queue>

#include <cmath>

#include <set>

#include <map>

const int oo=2139063143;

const int N=1010000;

const int P=1000000007;

using namespace std;

typedef long long LL;

typedef double db;

//char buf[1<<24],*p1=buf,*p2=buf,obuf[1<<23],*O=obuf;

//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)

typedef int DATA1;

typedef int DATA2;

inline void sc (DATA1 &x)

{

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

    while (!isdigit(c)) { if (c=='-') p=-1; c=getchar(); }

    while ( isdigit(c)) { x=(x<<1)+(x<<3)+(c-48); c=getchar(); }

    x*=p;

}

inline void print (DATA2 x)

{

	if (x< 0) putchar('-'),x=-x;

	if (x>=10) print(x/10);

	putchar(x%10+'0');

}

inline void pr (DATA2 x) { print(x),putchar('\n'); }

char change (char c)

{

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

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

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

	return 'p';

}

char s[N];

int main()

{

	//freopen (".in","r",stdin);

	//freopen (".out","w",stdout);

	scanf ("%s",s+1);

	int n=strlen (s+1);

	if (n&1) { puts("No"); return 0; }

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

		if (s[i]!=change (s[n-i+1])) { puts("No"); return 0; }

	puts("Yes");

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

int main() {

	string a, b;

	cin >> a;

	b = a;

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

	for(int i = 0; i < b.size(); 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 if(b[i] == 'q') b[i] = 'p';

	}

	cout << (b == a ? "Yes" : "No");

}

// Optimized solution to the same problem (faster):
#include <algorithm>

#include <cstdlib>

#include <cstring>

#include <cstdio>

#include <string>

#include <queue>

#include <cmath>

#include <set>

#include <map>

const int oo=2139063143;

const int N=1010000;

const int P=1000000007;

using namespace std;

typedef long long LL;

typedef double db;

//char buf[1<<24],*p1=buf,*p2=buf,obuf[1<<23],*O=obuf;

//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)

typedef int DATA1;

typedef int DATA2;

inline void sc (DATA1 &x)

{

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

    while (!isdigit(c)) { if (c=='-') p=-1; c=getchar(); }

    while ( isdigit(c)) { x=(x<<1)+(x<<3)+(c-48); c=getchar(); }

    x*=p;

}

inline void print (DATA2 x)

{

	if (x< 0) putchar('-'),x=-x;

	if (x>=10) print(x/10);

	putchar(x%10+'0');

}

inline void pr (DATA2 x) { print(x),putchar('\n'); }

char change (char c)

{

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

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

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

	return 'p';

}

char s[N];

int main()

{

	//freopen (".in","r",stdin);

	//freopen (".out","w",stdout);

	scanf ("%s",s+1);

	int n=strlen (s+1);

	if (n&1) { puts("No"); return 0; }

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

		if (s[i]!=change (s[n-i+1])) { puts("No"); return 0; }

	puts("Yes");

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cmath>

#include <cstdio>

#include <cstring>

#include <algorithm>

#include <map>

using namespace std;

char y[1000000],temp[1000000]; 

int main(){

map<char,char> a;

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

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

cin>>y;

int m=strlen(y);

strcpy(temp,y);

for(int i=0;i<m/2;i++)swap(y[i],y[m-i-1]);

for(int i=0;i<m;i++)y[i]=a[y[i]];

if(strcmp(y,temp)==0)cout<<"Yes";

else cout<<"No";

return 0;

}


// Optimized solution to the same problem (faster):
#include <algorithm>

#include <cstdlib>

#include <cstring>

#include <cstdio>

#include <string>

#include <queue>

#include <cmath>

#include <set>

#include <map>

const int oo=2139063143;

const int N=1010000;

const int P=1000000007;

using namespace std;

typedef long long LL;

typedef double db;

//char buf[1<<24],*p1=buf,*p2=buf,obuf[1<<23],*O=obuf;

//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)

typedef int DATA1;

typedef int DATA2;

inline void sc (DATA1 &x)

{

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

    while (!isdigit(c)) { if (c=='-') p=-1; c=getchar(); }

    while ( isdigit(c)) { x=(x<<1)+(x<<3)+(c-48); c=getchar(); }

    x*=p;

}

inline void print (DATA2 x)

{

	if (x< 0) putchar('-'),x=-x;

	if (x>=10) print(x/10);

	putchar(x%10+'0');

}

inline void pr (DATA2 x) { print(x),putchar('\n'); }

char change (char c)

{

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

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

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

	return 'p';

}

char s[N];

int main()

{

	//freopen (".in","r",stdin);

	//freopen (".out","w",stdout);

	scanf ("%s",s+1);

	int n=strlen (s+1);

	if (n&1) { puts("No"); return 0; }

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

		if (s[i]!=change (s[n-i+1])) { puts("No"); return 0; }

	puts("Yes");

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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";

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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";

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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");

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
# 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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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";  		

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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";

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem: