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

using namespace std;

#define maxn 500000

char a[maxn],b[maxn];

int s=1;

int main(){

	while(cin>>a[s]){

		s++;

	}

	for(int i=1;i<=s-1;i++){

		b[i]=a[i];

	}

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

		swap(a[i],a[s-i]);

	}



	for(int i=1;i<=s-1;i++){

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

		}

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

		 }

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

		}

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

		}

	}

	

	for(int i=1;i<=s-1;i++){

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

			cout<<"No"<<endl;return 0;

		}

	}

	cout<<"Yes"<<endl;

	return 0;

}

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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

using namespace std;

#define maxn 500000

char a[maxn],b[maxn];

int s=1;

int main(){

    while(cin>>a[s]){

        s++;

    }

    for(int i=1;i<=s-1;i++){

        b[i]=a[i];

    }

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

        swap(a[i],a[s-i]);

    }



    for(int i=1;i<=s-1;i++){

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

        }

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

         }

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

        }

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

        }

    }

    

    for(int i=1;i<=s-1;i++){

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

            cout<<"No"<<endl;return 0;

        }

    }

    cout<<"Yes"<<endl;

    return 0;

}

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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

using namespace std;

string s1,s2;

int main(){

	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;

}

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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

#include<cstdio>

#include<cmath>

#include<algorithm>

#include<cstring>

#define rep(i,a,b,k) for(register ll i=a;i<=b;i+=k)

#define drep(i,a,b,k) for(register ll i=a;i>=b;i-=k)

#define ll long long

#define mod 1000000007

using namespace std;

char a[100005];

int len;

bool flag=1;

int main()

{

	scanf("%s",&a);

	len=strlen(a)-1;

	if(!(len&1))

		puts("No"),exit(0);

	for(int i=0,j=len;i<j;i++,j--)

	{

		if((a[i]=='p'&&a[j]=='q')||(a[i]=='q'&&a[j]=='p')||(a[i]=='d'&&a[j]=='b')||(a[i]=='b'&&a[j]=='d'));

		else

		{

			flag=0;

			break;

		}

	}

	if(flag)

		puts("Yes"),exit(0);

	puts("No");

}

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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

#include<string>

using namespace std;

int main()

{

	string s,ss;

	cin>>s;

	ss=s;

	int len=s.length();

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

		swap(s[i],s[len-i-1]);

	for(int i=0;i<len;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;

		}

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

		else cout<<"No";

	return 0;

}

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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

using namespace std;

const int maxn=100100;

char a[maxn],b[maxn];

int main(){

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

	int len=strlen(b+1);

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

		a[i]=b[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';

	}

	int flag=0;

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

		if(b[i]!=a[len-i+1]){

			flag=1;

//			cout<<a[i]<<" "<<a[len-i+1];

			break;

		}

	}

	if(flag==1) cout<<"No";

	else cout<<"Yes";

	return 0;

} 

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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

#include <string.h>

using namespace std;



char s[100010];

char s1[100010];



int main()

{

    cin>>s;

    int l = strlen(s);

    if(l&1)

    {

        cout<<"No"<<endl;

        return 0;

    }

    for(int i=0;i<l;i++) s1[i] = s[l-i-1]; 

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

    {

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

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

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

        else s1[i] = 'p';

    }

    if(!strcmp(s1, s)) cout<<"Yes"<<endl;

    else cout<<"No"<<endl;

    return 0;

}

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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

}
// 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.354049108394832x):
#include<stdio.h>

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

#include<cstring>

#include<map>

using namespace std;

map<char,char>mp;

int main()

{

    mp['p']='q';

    mp['q']='p';

    mp['b']='d';

    mp['d']='b';

    char s[100010];

    scanf("%s",s);

    for(int i=0;i<strlen(s);i++)

    {

        if(mp[s[i]]!=s[strlen(s)-i-1])return !printf("No");

    }

    return !printf("Yes");

}

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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

using namespace std;

string a,b;

int main() {

	cin>>a;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.331873595162907x):
#include<stdio.h>

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

#include <string>

using namespace std;

int main(){

    string a;

    cin>>a;

    string b=a;

    a="";

    int x=b.size();

    int i;

    for (i=0;i<x;i++) a=b[i]+a;

    for(int i=0;i<x;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.369274170186996x):
#include<stdio.h>

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

using namespace std;

string st,st1,ans,sum;

int main()

{

	cin>>st;

	st1=st;

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

	

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

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

			st[i]='d'; continue;

		}

		if(st[i]=='d') {

			st[i]='b'; continue;

		}

		if(st[i]=='p') {

			st[i]='q'; continue;

		}

		if(st[i]=='q') {

			st[i]='p'; continue;

		}

    }

	if(st1==st) cout<<"Yes";

	else cout<<"No";

    return 0;

}

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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

using namespace std;

string s,st;

int p;

int main()

{

	cin>>s;

	st=s;

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

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

	{

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

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

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

		else st[i]='p';

	}

	if (st==s) cout<<"Yes"<<endl; else cout<<"No"<<endl;

	return 0;

}

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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

using namespace std;

string a,b;

int main() {

	cin>>a;

	b=a;

	int j=a.size();

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

		a[--j]=b[i];

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

	else cout<<"No\n";

	return 0;

}

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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

#include <string>

#include <cstdio>

#include <cstring>

#include <algorithm>

using namespace std;



int len;

bool flag=true;

string s1,s2;



int main(){

	cin>>s1;

	len=s1.length();

	s2=s1;

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

		s2[i]=s1[len-i-1];

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

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

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

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

	}

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

		if(s1[i]!=s2[i]) flag=false;

	if(flag) printf("Yes");

	else printf("No");

	return 0;

}

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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

using namespace std;

string a,b;

int i;

int main()

{

	cin>>a;

	b=a;

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

	for(i=0;i<a.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';

	}

//	for(i=0;i<=3;i++) if(a[i]!=b[i]){cout<<"No"<<endl;return 0;}

//	cout<<"Yes"<<endl;

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

	else cout<<"No"<<endl;

	return 0;

}

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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

using namespace std;

int main()

{

    string n;

    cin>>n;

    string b=n;

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

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

    {

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

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

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

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

    }

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

    else cout<<"No";

}

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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

using namespace std;

int main(){

    string s1;

    cin>>s1;

    string b=s1;

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

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

    {

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

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

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

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

    }

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

    else cout<<"No";

     cout<<endl;

}


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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

#include<cstdio>

#include<cstring>

using namespace std;

char a[1000001],c[1000001];

int main(){

    int b,sum=0,l=0;

    cin>>a;

    b=strlen(a);

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

        c[sum]=a[i];

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

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

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

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

        sum++;

    }

    for(int i=0;i<=b-1;i++) {

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

            cout<<"No"<<endl;

            return 0;

        }

    }

    cout<<"Yes"<<endl;

    return 0;

}

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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

using namespace std;string s;int main(){cin>>s;string q=s;reverse(q.begin(),q.end());for(int i=0;i<s.size();i++){if(q[i]=='b')q[i]='d';else if(q[i]=='d')q[i]='b';else if(q[i]=='p')q[i]='q';else if(q[i]=='q')q[i]='p';}if(s==q)printf("Yes\n"); else printf("No\n");} 

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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

#include<string>

using namespace std;

char ch[256];

int main()

{

	ch['b']='d';

	ch['d']='b';

	ch['q']='p';

	ch['p']='q';

	string s;

	cin>>s;

	int i;

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

	{

		if(ch[s[i]]!=s[s.size()-1-i]) goto br;

	}

	printf("Yes\n");

	return 0;

	br:;

	printf("No\n");

	return 0;

}


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

#include<string.h>

char a[100000010];

int main(){

    scanf("%s",a);

    int t=1;

    for(int i=0;i<=(strlen(a)-1)/2;i++){

        if((a[i]=='d'&&a[strlen(a)-i-1]=='b')||(a[i]=='b'&&a[strlen(a)-i-1]=='d')||(a[i]=='q'&&a[strlen(a)-i-1]=='p')||(a[i]=='p'&&a[strlen(a)-i-1]=='q'));

        else t=0;

    }

    if(t)printf("Yes");

    else printf("No");

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

#include<iostream>

#include<stack>

using namespace std;



stack<char>a;

char c [100004];

int bo;



char zh ( char p );



int main()

{

	string c;

	getline(cin,c);

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

	{

		a.push(c[i]);

	}

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

	{

		if(c[i]==zh(a.top()))

			a.pop();

		else

		{

			bo=1;

			break;

		}

	}

	if(bo==1)

		cout<<"No";

	else

		cout<<"Yes";

	return 0;

	}

char zh(char p)

{

	switch(p)

	{

		case 'p':return 'q';

		case 'q':return 'p';

		case 'b':return 'd';

		case 'd':return 'b';

	}

	return '0';

}

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

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

	for (int i = 0;i < len1;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';

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

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

#include<iostream>

#include<cstring>

#define maxn 100005

using namespace std;

char a[maxn],b[maxn];

char f[maxn];

int main(){

	f['b']='d';f['d']='b';

	f['p']='q';f['q']='p';

	cin>>a;int la=strlen(a);

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

		b[i]=f[a[la-i-1]];

	}

	int tip=0;

	for(int i=0;i<=la-1;i++){

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

			tip=1;break;

		}

	}

	if(tip==0) cout<<"Yes";

	else cout<<"No";

	return 0;

}

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

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

	for (int i = 0;i < len1;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';

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

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

#include<stack>

using namespace std;

stack<char>s;

string k;

int main(){

    cin>>k;

    int lk=k.length();

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

	{

        s.push(k[i]);

    }

    bool flag=1;

    for(int i=0;i<lk;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==k[i])

		 {

            flag=1;

            s.pop();

        }

        else 

		{

            flag=0;

            break;

        }

    }

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

    else printf("Yes");

    return 0;

}

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

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

	for (int i = 0;i < len1;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';

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

}