stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<iostream>

#include<cstdio>

#include<algorithm>

#include<cstring>

#include<string>

#include<cmath>

using namespace std;

string s,st;

int main()

{

	cin >>s;

	st="";

	for (int i=s.size()-1; i>=0; i--)

	    st+=s[i];

	for (int i=0; i<st.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 if (st[i]=='q') st[i]='p';

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

	   else cout<<"No";

	return 0;

}

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

#include<string>

using namespace std;

string s;

int main()

{

	cin>>s;

	int len=s.length();

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

		if((s[i]=='b' && s[len-1-i]=='d')||(s[i]=='d' && s[len-1-i]=='b')||(s[i]=='p' && s[len-1-i]=='q')||(s[i]=='q' && s[len-1-i]=='p'))

			continue;

		else

		{

			cout<<"No";

			return 0;

		}

	cout<<"Yes";

	return 0;

}

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

int main()

{

    cin>>st1;

    int m=-1;

    for (int i=st1.size()-1;i>=0;i--) 

    {

    	m++;

        st2+=st1[i];

        if (st2[m]=='b') st2[m]='d'; else

        if (st2[m]=='d') st2[m]='b';

        if (st2[m]=='p') st2[m]='q'; else

        if (st2[m]=='q') st2[m]='p';

    }

    if (st1==st2) cout<<"Yes"; else cout<<"No";

    return 0;

}

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

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

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

	char a[100005];cin>>a;

	int s=strlen(a);int sum=0;

	if(s%2!=0){

		cout<<"No";return 0;

	}

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

		if(a[i]=='p'&&a[s-i-1]=='q')sum++;

		if(a[i]=='q'&&a[s-i-1]=='p')sum++;

		if(a[i]=='d'&&a[s-i-1]=='b')sum++;

		if(a[i]=='b'&&a[s-i-1]=='d')sum++;

	}

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

	else cout<<"No";

	return 0;

} 

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

template <typename T>

inline void RI(T &x)

{

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

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

    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}

    if(f) x=-x;

}

char A[1000005],B[1000005];

int N;



int main()

{

    scanf("%s",A);N=strlen(A);

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

        B[i]=A[N-i-1];

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

    }

    bool f=1;

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

        f&=A[i]==B[i];

    if(f) printf("Yes\n");

    else printf("No\n");

    return 0;

}

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

#include <string>

using namespace std;

int main(){

    string a;

    cin>>a;

    string b=a;

    a="";//记得把原字符串清0

    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"<<endl;//判断是否相同

    else cout<<"No"<<endl;

    return 0;

}

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

#include<cstring>

#include<cstdio>

using namespace std;

char a[100005],b[100005];

bool flag=false;

int main()

{

	cin>>a;

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

	  //b[i]=a[strlen(a)-i-1];

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

		b[i]=a[strlen(a)-i-1];

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

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

		  flag=true;

	if(flag==false) cout<<"Yes"<<endl;

	else cout<<"No"<<endl;

	return 0;

}

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

#include<cmath>

#include<cstdio>

#include<string>

#include<cstring>

#include<cstdlib>

#include<algorithm>

using namespace std;

int ln,i;

string st,ts;



int main()

{

    cin>>st;

    ln=st.size();

    for(i=0; i<ln; i++)

    {

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

            ts='d'+ts;

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

            ts='b'+ts;

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

            ts='q'+ts;

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

            ts='p'+ts;        

    }

    if(st==ts)

        cout<<"Yes";

    else

        cout<<"No";

    return 0;

}

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

#include<cstdio>

#include<cstdlib>

#include<algorithm>

#include<cmath>

#include<string>

using namespace std;

string st;

int f[1000+5][1000+5],l;

int main()

{

    f[int('b')][int('d')]=1;f[int('d')][int('b')]=1;

    f[int('p')][int('q')]=1;f[int('q')][int('p')]=1;

    cin>>st;

    st=" "+st;l=st.size();l--;

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

      if (f[int(st[i])][int(st[l-i+1])]==0) {cout<<"No";return 0; } 

    cout<<"Yes";

	return 0;

}


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

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

char ch[100010], a[100010];

int main() {

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

	int len = strlen (ch + 1);

	for (int i = 1; i <= len; i++)  a[i] = ch[len-i+1];

	for (int i = 1; i <= len; 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 <= len; i++) if (a[i] != ch[i]) {puts ("No"); return 0;}

	puts ("Yes");

	return 0;

}

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

#include<bits/stdc++.h>

using namespace std;

int main(){

	string a;

	cin>>a;

	string b;

	b=a;

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

	int n=b.size();

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

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

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

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

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

	}

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

	else cout<<"No"<<endl;

}

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

using namespace std;

string a,b;

int main() 

{

    getline(cin,a);

    b=a;

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

    for ( re int i=0;i<a.length();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) return printf("Yes\n"),0;

    else printf("No\n"),0;

    return 0;

}

        

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

#include <algorithm>



using namespace std;



int main(int argc, char *argv[]) {

    string s;

    

    cin >> s;

    string t = "";

    string r = s;

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

    

    for (int i = 0; i < r.length(); i++) {

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

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

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

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

    }

    

    if (t == s) {

        cout << "Yes" << endl;

    }

    else {

        cout << "No" << endl;

    }

    

    return 0;

}

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



int main(){

    cin>>s;

    c=s;

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

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

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

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

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

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

    }

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

    else cout<<"No"<<"\n";

    return 0;

}

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

    cin>>s1;

    s2=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 == s2) cout<<"Yes";

    else cout<<"No";

    return 0;

}///

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

#include<cstdio>

#include<cstring>

using namespace std;

string s;

int main()

{

	cin>>s;

	int len=s.size();

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

	{

		if(s[i]=='b'&&s[len-i-1]=='d') continue;

		if(s[i]=='d'&&s[len-i-1]=='b') continue;

		if(s[i]=='p'&&s[len-i-1]=='q') continue;

		if(s[i]=='q'&&s[len-i-1]=='p') continue;

		cout<<"No";

		return 0;

	}

	cout<<"Yes";

	return 0;

} 

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

#include<algorithm>

#include<string>

using namespace std;

string a,b;

int main()

{

    cin >> a;b=a;

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

    for(unsigned 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';

    }

    bool(a==b)?cout << "Yes\n":cout << "No\n";

    return 0;

}

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

#include <cstdio>

#include <cctype>

#include <cstring>

#include <string>

#include <cstdlib> 

using namespace std;

int a[100010], b[100010];

int main() {

	int top = 0;

	char ch = getchar();

	while (!isalpha(ch)) ch = getchar();

	while (isalpha(ch)) {

		if (ch == 'b') a[++top] = 0;

		if (ch == 'd') a[++top] = 1;

		if (ch == 'p') a[++top] = 2;

		if (ch == 'q') a[++top] = 3;

		ch = getchar();

	}

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

		b[i] = a[top - i + 1] ^ 1;

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

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

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

	puts("Yes");

	return 0;

}


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



int main()

{

	getline(cin, s);

	s1 = s;

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

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

	{

		if (s1.at(i) == 'b') s1.at(i) = 'd';

		else if (s1.at(i) == 'd') s1.at(i) = 'b';

		else if (s1.at(i) == 'p') s1.at(i) = 'q';

		else if (s1.at(i) == 'q') s1.at(i) = 'p';

	}

	if (s1 == s) puts("Yes"); else puts("No");

	return 0;

}


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

#define ri int 

#define ll long long 

using namespace std;

string a,b;

int main(){

	cin>>a;

	b=a;

	int len=a.size();

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

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

		a[i]='p';

	}

	if(a==b)

	cout<<"Yes";

	else 

	cout<<"No";

	

	

	

	return 0;

} 

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

}