stablegradients/pie-gem5-pairs huggingface dataset:
// 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.3692314899674995x):
#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;

}
// 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.277871686967518x):
#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;

}
// 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.277621931605926x):
#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;

}
// 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.289488792610794x):
#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;

}
// 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.282199849546554x):
#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;

}
// 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.370576438495746x):
#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;

}
// 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.331711629134236x):
#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;

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

#include<cstdio>

#include<algorithm>

#define reg register

#define ios ios::sync_with_stdio(false)

using namespace std;

int t[101],p[101];

int main() 

{

	ios;string s1,s2;cin>>s1;s2=s1;

	reverse(s2.begin(),s2.end());//交换函数abc->cba //orz%%%dalao

	int l=s2.length();

	for(reg int i=0;i<=l-1;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;}

	}

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

	else	puts("No");

    return 0;

}

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

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

char s[200000];

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;

}

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

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

using namespace std;

bool ismirror(string s)

{

	string ss;

	int len = s.size();

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

	{

		ss += ' ';

	}

	int h = 0;

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

	{

		ss[h++] = s[i];

	}

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

	{

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

		{

			ss[i] = 'd';

			continue;

		}else if(ss[i] == 'd')

		{

			ss[i] = 'b';

			continue;

		}else if(ss[i] == 'p')

		{

			ss[i] ='q';

			continue;

		}else if(ss[i] == 'q')

		{

			ss[i] = 'p';

			continue;

		}

	}

	if(ss == s)

	{

		return true;

	}else

	{

		return false;

	}

}

int main()

{

	string s;

	cin>>s;

	if(ismirror(s))

	{

		cout<<"Yes";

	}else cout<<"No";

	return 0;

	

}

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

}
// 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.3740983882466x):
#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;

}
// Slower C++ solution:
#include<bits/stdc++.h>//'三玖是天！ '.

using namespace std;

int main()

{

	string s,ss;

	cin>>s;

	ss=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 s[i]='p';

	}

	if(ss==s)cout<<"Yes"<<endl;

	else cout<<"No"<<endl;

	return 0;

}

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

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

#include<string>

using namespace std;

char f[256];

int main()

{

	 string s,a;

	 f['b']='d';

	 f['d']='b';

	 f['p']='q';

	 f['q']='p';

	 cin>>s;

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

		 a=a+s[i];

	 //cout<<a<<endl;

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

		 a[i]=f[a[i]];

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

		   else cout<<"No";

}

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

}