stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#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;

}

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

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

}

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

}

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

}


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

}

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

}

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

}

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

}

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

}

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

{

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

}

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

    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;

}


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

}

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

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

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;

}


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

	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;

}

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

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;

}

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

    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;

}

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

}

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

}

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

}