stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

   char s[100860];

int main(){

 

    scanf("%s",&s);

    int n=strlen(s);

    if(n%2!=0){

        cout<<"No"<<endl;

        return 0;

    }

    else {

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

		int num=abs(s[i]-s[n-1-i]);

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

		{

			cout<<"No"<<endl;

			return 0;

		}

    }}

    cout<<"Yes"<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.32175831084687x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

int main()

{

	char s[1000001];

	scanf("%s",&s);

	int len=strlen(s);

	int flag=1;

	if(len%2==1)

	{

		printf("No\n");

		return 0;

	}

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

	{

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

		{

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

			{

				flag=0;

				break;

			}

		}

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

		{

			if(s[len-1-i]!='d')

			{

				flag=0;

				break;

			}

		}

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

		{

			if(s[len-1-i]!='q')

			{

				flag=0;

				break;

			}

		}

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

		{

			if(s[len-1-i]!='p')

			{

				flag=0;

				break;

			}

		}

	}

    if(flag==0)printf("No\n");

    else printf("Yes\n");

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.1214641534184953x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

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

using namespace std;

const int N=100007;

char pre[N],fch[N];

int cnt,n;

char change(char ch){

	if(ch=='b')return 'd';

	if(ch=='d')return 'b';

	if(ch=='p')return 'q';

	if(ch=='q')return 'p';

}

int main(){

	pre[1]=getchar();

	cnt=1;

	char ch;

	while(cin>>ch){

		pre[++cnt]=ch;		

	}

	n=cnt++;

	//for(int i=1;i<=cnt;i++)cout<<pre[i];

	for(int i=n;i>=1;i--){

		fch[i]=change(pre[--cnt]);

	}

	cnt=n;

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

		if(fch[i]!=pre[cnt]){

			puts("No");

			return 0;

		}

		cnt--;

	}

	puts("Yes");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.267239821203254x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

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

#define l strlen(s)

using namespace std;

int main(){

	char s[100012]={};

    scanf("%s",&s);

    if(l%2==1){

        printf("No");

        return 0;

    }

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

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

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

            printf("No");

            return 0;

        }

    }

    printf("Yes");

}

// Faster C++ solution for the same problem (measured speedup: 5.788648341954663x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<iostream>

#include<cstring>

#include<stack>

using namespace std;

stack<char>s;

string a;

int main()

{

    cin>>a;

    int n=a.size();

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

        s.push(a[i]);

    bool ju=1;

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

    {

        char top=s.top();

        if(top=='b')

            top='d';

        else if(top=='d')

            top='b';

        else if(top=='p')

            top='q';

        else if(top=='q')

            top='p';

        if(top==a[i])

        {

            ju=1;

            s.pop();

        }

        else

        {

            ju=0;

            break;

        }

    }

    if(ju==0)

        printf("No");

    else

        printf("Yes");

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.346487189753596x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

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

using namespace std; 

int main(){

    char a[100005],b[100005];

    cin>>a;

    int a1=strlen(a),ans=0;

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

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

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

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

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

    }

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

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

            cout<<"No";

            return 0;

        }

    }

    cout<<"Yes";

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.3081933058266015x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

}
// Slower C++ solution:
#include <cstring>

#include <iostream>

#include <cstdio>



const int M = 500500;

char c[M], ch[M];

int len;



int main()

{

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

	len = strlen(c + 1);

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

	{

		switch (c[i])

		{

			case 'b':{

				ch[i] = 'd';

				break;

			}

			case 'd':{

				ch[i] = 'b';

				break;

			}

			case 'p':{

				ch[i] = 'q';

				break;

			}

			case 'q':{

				ch[i] = 'p';

				break;

			}

		}

	}

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

		if (c[i] != ch[len - i + 1])

		{

			puts("No");

			return 0;

		}

	puts("Yes");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.255073611976013x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<iostream>

#include<cstring>

using namespace std;

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

int main(){

	cin>>s;

	int flag=1,len=strlen(s);

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

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

		if (L>R)

		break;

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

		flag=0;

		else {

			flag=1;

			break;

		}

	}

	if(!flag){

		cout<<"Yes"<<endl;

		return 0;

	}

	int cnt=0;

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

		s2[i]=s[i];

	for(int i=0;i<len;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(s2[i]==s[i])

		 cnt=1;

		 else{

		 		cnt=0;

		 		break;

			 }

	}

	if(cnt==1){

		cout<<"Yes"<<endl;

		return 0; 

	}

	

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

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

		

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

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

		 flag=0;

		else 

		{

			flag=1;

			break;

		}

	}

	if(!flag)

	{

		cout<<"Yes"<<endl;

		return 0;

	}

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

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

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

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

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

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

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

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

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

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

		 cnt=1;

		 else

		 	{

		 		cnt=0;

		 		break;

			 }

	}

	if(cnt==1)

	{

		cout<<"Yes"<<endl;

		return 0; 

	}

	cout<<"No"<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.323824378882609x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <cstring>

#include <iostream>

#include <algorithm>

using namespace std;

int main()

{

    std::ios::sync_with_stdio(false);

	string s;

	cin>>s;

	string x=s;

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

	int n=s.length();

	for(int i=0;i<n;++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(x==s)puts("Yes");

	else puts("No");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.380195263608771x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <algorithm>

using namespace std;

int main()

{

    string a,b;

    cin>>a;

    b=a;

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

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

		switch(a[i])

		{

			case 'b':a[i]='d';break;

			case 'd':a[i]='b';break;

			case 'p':a[i]='q';break;

			case 'q':a[i]='p';break;

		} 

    if(a==b)

		cout<<"Yes"<<endl;

    else

		cout<<"No"<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.36823828951185x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

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



using namespace std;

string a;

int main()

{

	cin>>a;

	int len=a.size();

	if(len%2==1) 

	{

		cout<<"No";

		cout<<endl;

		return 0;

	}

	int r=0;

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

		{

			r=1;

			break;

		}

	}

	if(r==0) cout<<"Yes";

	else cout<<"No";

	cout<<endl;

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.328350315701042x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

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

using namespace std;

char s[100010];

int main()

{

	scanf("%s",s);

	int l=strlen(s);

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

	{

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

		{

			cout<<"No";

			return 0;

		}

	}

	cout<<"Yes";

}

// Faster C++ solution for the same problem (measured speedup: 5.26846333046384x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

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

using namespace std;

#define maxn 500000

char a[maxn],b[maxn];

int s=1;

int main(){

	while(cin>>a[s]){

		s++;

	}

	for(int i=1;i<=s-1;i++){

		b[i]=a[i];

	}

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

		swap(a[i],a[s-i]);

	}



	for(int i=1;i<=s-1;i++){

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

		}

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

		 }

		if(a[i]=='p'){a[i]='q';continue;

		}

		if(a[i]=='q'){a[i]='p';continue;

		}

	}

	

	for(int i=1;i<=s-1;i++){

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

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

		}

	}

	cout<<"Yes"<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.321878415965595x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

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

using namespace std;

#define maxn 500000

char a[maxn],b[maxn];

int s=1;

int main(){

    while(cin>>a[s]){

        s++;

    }

    for(int i=1;i<=s-1;i++){

        b[i]=a[i];

    }

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

        swap(a[i],a[s-i]);

    }



    for(int i=1;i<=s-1;i++){

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

        }

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

         }

        if(a[i]=='p'){a[i]='q';continue;

        }

        if(a[i]=='q'){a[i]='p';continue;

        }

    }

    

    for(int i=1;i<=s-1;i++){

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

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

        }

    }

    cout<<"Yes"<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.321561388060147x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

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

using namespace std;

string s1,s2;

int main(){

	getline(cin,s1);

	s2=s1;

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

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

		s2[i]=='b'?s2[i]='d':s2[i]=='d'?s2[i]='b':s2[i]=='p'?s2[i]='q':s2[i]='p';

	if(s1==s2)	puts("Yes");

	else	puts("No");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.293554362612983x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

}
// Slower C++ solution:
#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");

}

// Faster C++ solution for the same problem (measured speedup: 5.256543323282038x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.355690382690948x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

}
// Slower C++ solution:
#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;

} 

// Faster C++ solution for the same problem (measured speedup: 5.311542846029302x):
#include<cstdio>

#include<cstring>

using namespace std;



char a[100005];

char b[100005];

int len1,len2;



int main()

{

	scanf("%s",a);

	len1 = strlen(a);

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

		b[i] = a[i];

	len2 = len1 / 2;

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

	{

		char k;

		k = a[i];

		a[i] = a[len1 - 1 - i];

		a[len1 - 1 - i] = k;

	}

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

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

		{

			printf("No\n");

			return 0;

		}

	printf("Yes\n");

	return 0;

}