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

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

	return 0;

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

using namespace std;

int main()

{

    string a,b;

    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) printf("Yes");

    else printf("No");

    return 0;

}

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

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

	return 0;

}
// Slower C++ solution:
// =================================

//   author: memset0

//   date: 2018.12.25 22:11:27

//   website: https://memset0.cn/

// =================================

#include <bits/stdc++.h>

#define rep(i, l, r) for (register int i = l; i <= r; i++)

namespace ringo {

typedef long long ll;

typedef unsigned long long ull;

template <class T> inline void read(T &x) {

	x = 0; register char c = getchar(); register bool f = 0;

	while (!isdigit(c)) f ^= c == '-', c = getchar();

	while (isdigit(c)) x = x * 10 + c - '0', c = getchar();

	if (f) x = -x;

}

template <class T> inline void print(T x) {

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

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

	putchar('0' + x % 10);

}

template <class T> inline void maxd(T &a, T b) { if (b > a) a = b; }

template <class T> inline void mind(T &a, T b) { if (b < a) a = b; }

template <class T> inline void print(T x, char c) { print(x), putchar(c); }

template <class T> inline T abs(const T &a) { if (a < 0) return -a; return a; }



const int N = 1e5 + 10;

int n, m, a[N], b[N];

char s[N];



void main() {

	scanf("%s", s + 1), n = strlen(s + 1);

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

		switch (s[i]) {

			case 'b': a[i] = 0; break;

			case 'p': a[i] = 1; break;

			case 'd': a[i] = 2; break;

			case 'q': a[i] = 3; break;

		}

	for (int i = 1; i <= n; i++) b[i] = a[i];

	std::reverse(b + 1, b + n + 1);

	for (int i = 1; i <= n; i++) b[i] = (b[i] + 2) % 4;

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

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

			puts("No");

			return;

		}

	puts("Yes");

}



} signed main() { return ringo::main(), 0; }

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

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

	return 0;

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

#define rep(i,a,b) for(int i=a;i<=b;i++)

using namespace std;

string s;

int main(){

    cin>>s;

    string s1(s);

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

    rep(i,0,(int)s.size()-1){

        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==s)printf("Yes");

    else printf("No");

    return 0;

}

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

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

	return 0;

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

using namespace std;

char s[100005],ss[100005];

signed main(){

	scanf("%s",s);

	int len=strlen(s);

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

		switch(s[i]){

			case 'b':{ss[len-i-1]='d';break;}

			case 'd':{ss[len-i-1]='b';break;}

			case 'p':{ss[len-i-1]='q';break;}

			case 'q':{ss[len-i-1]='p';break;}

		}

	}

	if(strcmp(s,ss))printf("No");

	else printf("Yes");

	return 0;

}

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

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

	return 0;

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

using namespace std;

char a[100010],b[100010];

int main(void){

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

    int cnt=0;

    for(int i=strlen(a+1);i>=1;i--){

        b[++cnt]=a[i];

    }

    for(int i=1;i<=strlen(a+1);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=1;i<=strlen(a+1);i++){

        if(a[i]==b[i]) continue;

        else{

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

}

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

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

	return 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++)

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

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

	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) printf("Yes"); else printf("No");

}

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

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

	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一定要加,不然就白做了

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

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

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

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

	return 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.726091392730564x):
#include <stdio.h>

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

	return 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.039908841142378x):
#include <stdio.h>

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

	return 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.13225615163221x):
#include <stdio.h>

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

	return 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.098030179354178x):
#include <stdio.h>

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

	return 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.090613856283931x):
#include <stdio.h>

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

	return 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.08447143855361x):
#include <stdio.h>

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

	return 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.088041368569425x):
#include <stdio.h>

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

	return 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.132337090012995x):
#include <stdio.h>

#include <string.h>



int main()

{

	char String[100001],OutString[100001];

	scanf("%s",String);

	int StringLen = strlen(String),Pos = 0,Diff = 0;

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

		OutString[Pos] = String[i],Pos++;

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

	{

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

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

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

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

	}

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

		if(OutString[i] != String[i]) Diff++;

	if(Diff == 0) printf("Yes");

	else printf("No");

	return 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: 1.1888471841183892x):
#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;

}