stablegradients/pie-gem5-pairs huggingface dataset:
// 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.265969417929571x):
#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 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.308160831461912x):
#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;

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

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.269492878244457x):
#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++)

		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;

}