stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<cstring>

#include<cstdio>

#include<iostream>

#include<cmath>

#include<algorithm>

#include<iomanip>

using namespace std;

string s;

int main(){

	getline(cin,s);

	int n=s.size();

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

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

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

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

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

		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>

using namespace std;



int main() {

	string s1; cin >> s1;

	string s2 = s1;

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

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

		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';

	if(s1 == s2) 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:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

long long n,m,i,j,sum,ans;

string a,b,c;

int main()

{

    cin>>a;

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

	   b=a[i]+b;

    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;

}

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

}

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

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;

}

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

}

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

    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;

}

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

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

	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;

} 

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

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;

}

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

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;

}

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

}

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

}

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

}


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

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

}

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

}

// 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>

#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;

}

        

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

}

// 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,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;

}

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

}///

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

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;

} 

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

}

// 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: