stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#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");

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

} 

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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";

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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");

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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";

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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";

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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");} 

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main() {

	string a;

	cin>>a;

	string b=a;

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

	int len=a.size();

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

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

			b[i]='d';

		}

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

			b[i]='b';

		}

		else if(b[i]=='q') {

			b[i]='p';

		}

		else if(b[i]=='p') {

			b[i]='q';

		}

	}

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

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

		{

			continue;

		}

		else

		{

			cout<<"No";

			return 0;

		}

	}

	cout<<"Yes";

	return 0;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main(){

    string a;

    char k;

    cin>>a;

    string b="";

    for(int i=a.length()-1;i>=0;i--)

    {

        k=a[i];

        switch(k)

        {

            case 'b':b+="d";break;

            case 'd':b+="b";break;

            case 'p':b+="q";break;

            case 'q':b+="p";break;

        }

    }

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

    else cout<<"No"<<endl;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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) printf("Yes");

	else printf("No");

	return 0;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

char a[111111];

bool ok(char a,char b)

{

	if(a=='q'&&b=='p') return 1;

	if(a=='p'&&b=='q') return 1;

	if(a=='b'&&b=='d') return 1;

	if(a=='d'&&b=='b') return 1;

	return 0;

}

stack <char> s;

int main()

{

	cin>>a;

	for(int i=0;i<(strlen(a)+1)/2;i++) s.push(a[i]);

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

		if(!ok(s.top(),a[i])){

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

		}

		

		s.pop();

	}

	cout<<"Yes"<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

  int i;	

  string x,y;

  cin>>x;

  y=x;

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

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

    {

      if(x[i]=='b') 

	    x[i]='d';

      else 

	    if(x[i]=='d') 

		  x[i]='b';

      else 

	    if(x[i]=='p') 

		  x[i]='q';

      else 

	    if(x[i]=='q') 

		  x[i]='p';

    }

  if(x==y) 

	cout<<"Yes"<<endl;

  else 

	cout<<"No"<<endl;

  return 0;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem: