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

using namespace std;

string s,b;

int main(){

	cin>>s;

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

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

		switch(s[i]){

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

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

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

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

		}

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

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.310044749317112x):
#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) printf("Yes"); else printf("No");

}

// Faster C++ solution for the same problem (measured speedup: 5.30799571416509x):
#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一定要加,不然就白做了

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

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

    }

    if(a==b) cout<<"Yes";//判断

    else cout<<"No";

}

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

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

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

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

    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:
#include<cstdio>

#include<cstring>

#include<map>

using namespace std;

int len;

char c[100001];

map<char,char>m;

int main()

{

	m['b']='d',m['d']='b',m['p']='q',m['q']='p';

	scanf("%s",&c);

	len=strlen(c);

	if(len&1)

	{

	    puts("No");

	    return 0;

	}

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

	{

		if(c[i]!=m[c[len-i-1]])

		{

			puts("No");

			return 0;

		}

	}

	puts("Yes");

	return 0;

}

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

#define Max 1000005

using namespace std;

char a[Max];

int n;

bool check(int x)

{

	if(a[x]==a[n-x+1]&&a[x]!='d'&&a[x]!='p'&&a[x]!='q'&&a[x]!='b') return 1;

	if(a[x]=='d'&&a[n-x+1]=='b') return 1;

	if(a[x]=='b'&&a[n-x+1]=='d') return 1;

	if(a[x]=='q'&&a[n-x+1]=='p') return 1;

	if(a[x]=='p'&&a[n-x+1]=='q') return 1;

	return 0;

}

int main()

{

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

	n=strlen(a+1);

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

		if(!check(i)) puts("No"),exit(0);

	puts("Yes");

}

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

    int i;

	string a;

    cin>>a;

    string b=a;

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

    for(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.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 s,b;



int main() {

	cin>>s;

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

	else cout<<"No";

	return 0;

}

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

int main(){

	int i,j,k;

	getline(cin,s);

	ss=s;

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

	for(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==ss){

		cout<<"Yes\n";

		return 0;

	}

	cout<<"No\n";

	return 0;

}

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

#include<string>

#include<math.h>

#include<algorithm>

using namespace std;

string a;

char p[300];

int b=1,q;

void init()

{

    p['b'] = 'd';

    p['d'] = 'b';

    p['q'] = 'p';

    p['p'] = 'q';

}

int main()

{

    getline(cin,a);

    init();

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

    {

        if(p[a[i]]!=a[a.size()-1-i])

        {

            cout<<"No";

            return 0;

        }

    }

    cout<<"Yes";

}

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

#include <iostream>

using namespace std;

int l;

char s[100001],c[100001];

int main()

{

	cin>>s;

	l=strlen(s);

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

	{

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

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

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

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

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

		if(c[i]!=s[i])

		{

			cout<<"No";break;

		}

		if(i==l-1) cout<<"Yes";

	}

	return 0;

}

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

using namespace std;

int main()

{

    string s;

    cin>>s;

    string rs=s;

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

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

    {

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

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

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

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

    }

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

    else cout<<"No";

    return 0;

}

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

#include<iostream>

using namespace std;



int main()

{

	string a;

	cin>>a;

	if(a.size()%2!=0)

	{

		printf("No\n");

		return 0;

	}

	for(int i=0;i<=a.size()/2-1;i++)

	{

		if(a[i]=='p'&&a[a.size()-1-i]=='q')continue;

		else if(a[i]=='q'&&a[a.size()-1-i]=='p')continue;

		else if(a[i]=='d'&&a[a.size()-1-i]=='b')continue;

		else if(a[i]=='b'&&a[a.size()-1-i]=='d')continue;

		else

		{

			printf("No\n");

			return 0;

		}

	}

	printf("Yes\n");

	return 0;

}

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

int len;

int main()

{

	ios :: sync_with_stdio(false);

	cin >> s;

	len = s.size();

	if(len & 1) 

	{

		cout << "No";

		return 0;

	}

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

	{

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

			cout << "No";

			return 0;

		}

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

			cout << "No";

			return 0;

		}

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

			cout << "No";

			return 0;

		}

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

			cout << "No";

			return 0;

		}

	}

	cout << "Yes";

} 

// Faster C++ solution for the same problem (measured speedup: 5.401333449029701x):
#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=string(a.rbegin(),a.rend());

	for(int i=0; i<b.length(); 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';

	}

	if(b==a)

		cout<<"Yes";

	else

		cout<<"No";

}

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

#define MAXN 100005

#define reg register

#define inl inline

using namespace std;

char s[MAXN],ch[MAXN];

inl char Chg(reg char x)

{

	return x=='b'?'d':(x=='d'?'b':(x=='p'?'q':'p'));

}

int main()

{

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

	reg int len=strlen(ch+1);

	memcpy(s,ch,sizeof(ch));

	reverse(ch+1,ch+len+1);

	for(reg int i=1;i<=len;i++) ch[i]=Chg(ch[i]);

	reg bool fg=1;

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

	{

		if(ch[i]!=s[i])

		{

			fg=0;

			break;

		}

	}

	puts(fg?"Yes":"No");

	return 0;

}

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

#include<cstdlib>

#include<algorithm>

#include<string>

#include<queue>

#define re register

#define ll long long 

#define maxn 10010000

#define mod 6662333 

#define inf 2147483647

#define mem(p) memset(&p,0,sizeof(p))

using namespace std;

inline int read()

{ 

    int x=0,f=1;char c=getchar();

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

    while(isdigit(c)){x=x*10+c-48;c=getchar();}

    return x*f;

}

inline void put(ll x)

{

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

     if(x>9) put(x/10);

     putchar(x%10+'0');

}

char a[maxn],b[maxn];

int sum;

int main()

{

    cin>>a;

    sum=strlen(a);//求字符数组a的长度 

    sum-=1;

    for(int i=0;a[i]!='\0';i++)

	{

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

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

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

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

        sum--;

    }

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

	else cout<<"No"<<endl;

    return 0;

}

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

#include<cstdlib>

#include<algorithm>

#include<string>

#include<queue>

#define re register

#define ll long long 

#define maxn 10010000

#define mod 6662333 

#define inf 2147483647

#define mem(p) memset(&p,0,sizeof(p))

using namespace std;

inline int read()

{ 

    int x=0,f=1;char c=getchar();

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

    while(isdigit(c)){x=x*10+c-48;c=getchar();}

    return x*f;

}

inline void put(ll x)

{

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

     if(x>9) put(x/10);

     putchar(x%10+'0');

}

char a[maxn],b[maxn];

int sum;

int main()

{

    cin>>a;

    sum=strlen(a);//求字符数组a的长度 

    sum-=1;

    for(int i=0;a[i]!='\0';i++)

	{

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

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

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

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

        sum--;

    }

    if(strcmp(a,b)==false) cout<<"Yes";

	else cout<<"No";

    return 0;

}

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

using namespace std;

string s,s2;

int main()

{

	cin>>s;

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

	{

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

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

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

		else s2+='q';

	}

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

	else cout<<"No"<<endl;

	return 0;

}

/*



*/


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

}