stablegradients/pie-gem5-pairs huggingface dataset:
// 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 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";

    return 0;

}

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

long long i;

string s,S;

int main()

{

	std::ios_base::sync_with_stdio(false),cin.tie(0);

	cin>>s,S=s,reverse(s.begin(),s.end());

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

		s[i]==98?s[i]=100:s[i]==100?s[i]=98

			:s[i]==112?s[i]=113:s[i]==113?s[i]=112:0;

	s==S?puts("Yes"):puts("No");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.408438249892574x):
#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,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]=='q') b[i]='p';

		else b[i]='q';

	}

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

	else cout<<"No";

}

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

}

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

}

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

}


// Faster C++ solution for the same problem (measured speedup: 5.385609373370941x):
#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.330450607476531x):
#include<cstdio>

#include<cstring>

char c[100005],s[100005];

int main(){

	bool flag=0;

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

	strcpy(s,c+1);

	int n=strlen(c+1);

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

		if(c[i]!=c[strlen(c)-i+1]){flag=1;break;}

	}

	if(flag==0){printf("Yes\n");return 0;}

	flag=0;

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

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

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

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

		else c[i]='p';

	}

	if(strcmp(c+1,s)==0){printf("Yes\n");return 0;}

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

		char w=c[i];

		c[i]=c[n-i+1];

		c[n-i+1]=w;

	}

	if(strcmp(c+1,s)==0){printf("Yes\n");}

	else printf("No\n");

    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.239502726586772x):
#include<cstdio>

#include<cstring>

char c[100005],s[100005];

int main(){

	bool flag=0;

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

	strcpy(s,c+1);

	int n=strlen(c+1);

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

		if(c[i]!=c[strlen(c)-i+1]){flag=1;break;}

	}

	if(flag==0){printf("Yes\n");return 0;}

	flag=0;

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

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

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

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

		else c[i]='p';

	}

	if(strcmp(c+1,s)==0){printf("Yes\n");return 0;}

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

		char w=c[i];

		c[i]=c[n-i+1];

		c[n-i+1]=w;

	}

	if(strcmp(c+1,s)==0){printf("Yes\n");}

	else printf("No\n");

    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.265777860689683x):
#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 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.31951672307263x):
#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 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.3742917713369165x):
#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,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.369402317868524x):
#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: 5.450509989316691x):
#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 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.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;

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.349990122187678x):
#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 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.316232917541939x):
#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;

}