stablegradients/pie-gem5-pairs huggingface dataset:
// 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):
// luogu-judger-enable-o2

#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); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    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):
// luogu-judger-enable-o2

#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); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    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):
// luogu-judger-enable-o2

#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); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    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):
// luogu-judger-enable-o2

#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); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

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

using namespace std;

int main()

{

    string s;

    cin>>s;

    string t=s;

    int a=s.length();

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

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

    {

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

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

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

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

    }

    if(s==t) cout<<"Yes\n";

    else cout<<"No\n";

}

// Faster C++ solution for the same problem (measured speedup: 5.360966663205455x):
// luogu-judger-enable-o2

#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); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

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

using namespace std;



string s,r;



int main() {

	cin>>s;

	r=s;

	long long len=s.length();

	//cout<<len<<endl;

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

		r[i+1]=s[len-i-1];

	}

	for(long long i=len;i>=1;i--) {

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

	}

	

	/*

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

		cout<<r[i]<<" ";

	} 

	cout<<endl;

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

		cout<<s[i]<<" ";

	}

	cout<<endl;

	*/

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

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

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

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

		else r[i]='p';

	}

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

		//cout<<r[i]<<" "<<s[i]<<endl;

		if(r[i]!=s[i]) {

			cout<<"No"<<endl;

			return 0;

		}

	}

	cout<<"Yes"<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.3376274657707174x):
// luogu-judger-enable-o2

#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); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

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

using namespace std;

int main()

{

	string a,b;

	cin>>a;

	int l=a.size();

	b=a;

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

		switch(b[i])

		{

			case 'b':

				b[i]='d';

				break;

			case 'd':

				b[i]='b';

				break;

			case 'q':

				b[i]='p';

				break;

			case 'p':

				b[i]='q';

				break;

		}

	

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

		if(a[i]!=b[l-1-i])

		{

			cout<<"No";

			return 0;

		}

	

	cout<<"Yes";

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.364829324233177x):
// luogu-judger-enable-o2

#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); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    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):
// luogu-judger-enable-o2

#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); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}
// Slower C++ solution:
// luogu-judger-enable-o2

#include<bits/stdc++.h>

using namespace std;

char s[100009];

int main()

{

	scanf("%s",s);

	int l=strlen(s);

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

	{

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

		{

			printf("No");

			return 0; 

		}

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

		{

			printf("No");

			return 0; 

		}

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

		{

			printf("No");

			return 0; 

		}

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

		{

			printf("No");

			return 0; 

		}

	}

	printf("Yes");

}	

// Faster C++ solution for the same problem (measured speedup: 5.269104416265749x):
// luogu-judger-enable-o2

#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); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    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: 1.1943968365938693x):
#include<iostream>

#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

char s1[100100],s2[100100];



int main(){

	int cnt=0;

	cin>>s1;

	int len=strlen(s1);

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

		s2[cnt]=s1[i];

		if(s2[cnt]=='q')

			s2[cnt]='p';

		else if(s2[cnt]=='p')

			s2[cnt]='q';

		else if(s2[cnt]=='b')

			s2[cnt]='d';

		else if(s2[cnt]=='d')

			s2[cnt]='b';

		cnt++;

	}

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

		if(s1[i]!=s2[i]){

			printf("No\n");

			return 0;

		}

	}

	printf("Yes\n");

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

using namespace std;

char s[100010];

int main(){

    cin>>s;

    int k=strlen(s);

    if(k%2!=0){

        printf("No");

        return 0;

    }

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

        int u=abs(s[i]-s[k-i-1]);

        if(u!=1&&u!=2){

            printf("No");

            return 0;

        }

    }

    printf("Yes");

    return 0;

}

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

bool is;

char ch,now,a;

string s;

stack<int> t;

int main()

{

	cin>>s; int n=s.size();

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

	    t.push(s[i]);

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

	{

		now=t.top();

	    if(now=='b') a='d';

	    else if(now=='d') a='b';

	    else if(now=='p') a='q';

	    else if(now=='q') a='p';

	    if(a==s[i]) t.pop();

		else

		{

			is=1; break;

		}

	}

	if(!is) cout<<"Yes"<<endl;

	else cout<<"No"<<endl;

	return 0;

}

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

	if(s.size()&1) 

	{

        printf("No");

        return 0;

    }

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

	{

        int r=abs(s[i]-s[s.size()-i-1]);

        if(r!=1&&r!=2) 

        { 

            cout<<"No";

            return 0;

        }

    }

	cout<<"Yes";

	return 0;

}

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

using namespace std;

char a[100000];int x;

int main()

{

	scanf("%s",&a);x=abs(a[0]-a[l-1]);

	if(l%2==1){cout<<"No\n";return 0;}

	for(int i=0;i<l/2;i++,x=abs(a[i]-a[l-i-1]))

	  if(x!=1&&x!=2){cout<<"No\n";return 0;}

	cout<<"Yes\n";

	return 0;

}

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

{char a[100100],b[100100];

 cin>>a;

 strcpy(b,a);

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

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

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

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

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

	}

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

    if(a[i]!=b[strlen(a)-i-1])

      {printf("No\n");

       return 0;

	  }

 printf("Yes\n");

 return 0;

}

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

typedef long long LL;

using namespace std;



namespace IO {

    inline LL read() {

        LL o = 0, f = 1; char c = getchar();

        while (c < '0' || c > '9') { if (c == '-') f = -1; c = getchar(); }

        while (c > '/' && c < ':') { o = o * 10 + c - '0'; c = getchar(); }

        return o * f;

    }

    inline char recd() {

        char o; while ((o = getchar()) != '1' && o != '0'); return o;

    }

}

using namespace IO;



char Map[233];



int main() {

	Map['b'] = 'd';

	Map['d'] = 'b';

	Map['p'] = 'q';

	Map['q'] = 'p';



	string str; cin >> str;

	for (int pos = 0; pos <= str.size() / 2; pos++)

		if (Map[str[pos]] != str[str.size() - 1 - pos]) {

			puts("No"); return 0;

		}

	puts("Yes");

}


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

#include<cstring>

#include<string>

using namespace std;

char s[100001],s2[100010],s3[100001];

int flag=1,len,L,R;

int main(){

    cin>>s;

    len=strlen(s);

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

        L=i,R=len-i-1;

        if(s[L]==s[R])

        flag=0;

        else {

            flag=1;

            break;

        }

    }

    if(!flag){

        cout<<"Yes"<<endl;

        return 0;

    }

    int cnt=0;

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

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

        if(s2[len-i-1]=='b')

        s2[len-i-1]='d';

        else if(s2[len-i-1]=='d')

        s2[len-i-1]='b';

        else if(s2[len-i-1]=='p')

        s2[len-i-1]='q';

        else if(s2[len-i-1]=='q')

        s2[len-i-1]='p';

        if(s2[len-i-1]==s[len-i-1])

         cnt=1;

         else

         {

         	cnt=0;

         	break;

		 }

    }

    if(cnt==1){

        cout<<"Yes"<<endl;

        return 0;

    }

    cout<<"No"<<endl;

    return 0;

}

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

#include<vector>

#include<algorithm>

#include<map>

#include<stack>

#include<bits/stdc++.h>

using namespace std;

int read()

{

	int kk(0);

	bool fh=true;

	char ch=getchar();

	for(;ch<'0'||ch>'9';)

	{

		if(ch=='-')fh=false;

		ch=getchar();

	}

	for(;ch>='0'&&ch<='9';)

	{

		kk=(kk<<3)+(kk<<1)+(ch^48);

		ch=getchar();

	}

	return fh?kk:-kk;

}

long long readll()

{

	long long kk(0);

	bool fh=true;

	char ch=getchar();

	for(;ch<'0'||ch>'9';)

	{

		if(ch=='-')fh=false;

		ch=getchar();

	}

	for(;ch>='0'&&ch<='9';)

	{

		kk=(kk<<3)+(kk<<1)+(ch^48);

		ch=getchar();

	}

	return fh?kk:-kk;

}

#define INF 214748364

#define MOD 1000000007

#define MAXN

char s[100010],s1[100010];

map<char,char> mp;

int main()

{

	mp['d']='b';

	mp['b']='d';

	mp['q']='p';

	mp['p']='q';

	scanf("%s",s);

	int len=strlen(s);

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

	for(int i=0;i<len;i++)s1[i]=mp[s1[i]];

	if(strcmp(s,s1)==0)puts("Yes");

	else puts("No");

	return 0;

}

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

  int n=s.size();

  int ok=0;

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

  {

    int j=n-i-1;

    if((s[i]=='q'&&s[j]=='p')||(s[i]=='b'&&s[j]=='d') ||(s[i]=='d'&&s[j]=='b')||(s[i]=='p'&&s[j]=='q')) {continue;}

    ok=1;

  }

  if(ok==0)

  {

    cout<<"Yes"<<endl;

    return 0;

  }

  ok=0;

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

  {

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

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

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

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

  }

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

  {

    int j=n-i-1;

    if((s[i]=='q'&&s[j]=='p')||(s[i]=='b'&&s[j]=='d') ||(s[i]=='d'&&s[j]=='b')||(s[i]=='p'&&s[j]=='q')) {continue;}

    ok=1;

  }

  if(ok==0)cout<<"Yes"<<endl;

  else cout<<"No";

  return 0;

}


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

	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,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.354228018409972x):
#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;

}