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

#include<cstdio>

#include<cmath>

#include<algorithm>

#include<cstring>

#include<string>

using namespace std;

int i,n,j,k,m,l,o,p;

string s,a;

int main()

{

	cin>>s;

	a=s;

	for(i=0,j=a.length()-1;i<=j;i++,j--)

	{

	swap(a[i],a[j]);

	}

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

	{

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

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

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

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

	}

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

		else cout<<"No";

	return 0;

}

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

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	return 0;

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

#include<string>

using namespace std;

int main()

{

	string s;

	cin>>s;

	int cc=s.length();

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

	{

		if(s[i]=='b'){if(s[cc-i-1]!='d'){cout<<"No";return 0;}}

		if(s[i]=='d'){if(s[cc-i-1]!='b'){cout<<"No";return 0;}}

		if(s[i]=='p'){if(s[cc-i-1]!='q'){cout<<"No";return 0;}}

		if(s[i]=='q'){if(s[cc-i-1]!='p'){cout<<"No";return 0;}}

	}

	cout<<"Yes";

	return 0;

}


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

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	return 0;

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

using namespace std;

char a[100010],b[100010];

int main(void){

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

	int cnt=0;

	for(int i=strlen(a+1);i>=1;i--){

		b[++cnt]=a[i];

	}

	for(int i=1;i<=strlen(a+1);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[i]==b[i]) continue;

		else{

			printf("No\n");

			return 0;

		}

	}

	printf("Yes\n");

	return 0;

}

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

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	return 0;

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

using namespace std;

string s,t;

int len;

int main()

{

    cin>>s;

    t=s;

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

    len=s.length();

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

	    printf("Yes");

    else

	    printf("No");

	return 0;

}

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

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	return 0;

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

using namespace std;

string a,b;

int main()

{

    cin>>a;

    b=a;

    for(int i=0;i<a.size()/2;++i)swap(a[a.size()-1-i],a[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";

    else cout<<"No";

}

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

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	return 0;

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

using namespace std;

string s,ss;

int main()

{

    getline(cin,s);

    ss=s;

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

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

        switch(ss[i])

		{

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

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

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

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

        }

    s==ss?printf("Yes\n"):printf("No\n");

    return 0;

}

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

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	return 0;

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

#include<cstdio>

#include<algorithm>

#include<cstring>

#include<vector>

#include<cmath>

#include<map>

using namespace std;

typedef long long ll;

string a,b;

int main()

{

    cin>>a;

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

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

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

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

        else b+='b';

    }

    if(a==b) printf("Yes");

    else printf("No");

    return 0;

}


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

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	return 0;

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

using namespace std;

char a[100005],b[100005];

int main()

{

	cin>>a;

	

	int len=strlen(a);

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

	{

		int loc=len-i-1;

		b[loc]=a[i];

		if(b[loc]=='p') b[loc]='q';

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

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

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

	}

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

	if(a[i]!=b[i]) {cout<<"No"<<endl; goto u;}

	cout<<"Yes"<<endl;

	u: ;

	return 0;

}

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

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	return 0;

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

using namespace std;

int main()

{

    string a;

    cin>>a;

    string b=a;

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

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

    {

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

            b[i]='b';

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

            b[i]='d';

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

            b[i]='q';

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

            b[i]='p';

    }

    if(a==b)

        cout<<"Yes"<<endl;

    else

        cout<<"No"<<endl;

    return 0;

}

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

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	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.36148641274659x):
#include<algorithm>

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	return 0;

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

using namespace std;

string a,b;

map<char,char> mp;

int main(){

	mp['q']='p';

	mp['p']='q';

	mp['b']='d';

	mp['d']='b';

	cin>>a;

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

		b=mp[a[i]]+b;

	}

	if(b==a){

		printf("Yes");

	}

	else printf("No");

	return 0;

}

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

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	return 0;

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

using namespace std;

int main()

{

    string a;

    cin>>a;

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

    else cout<<"No";

    return 0;

}

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

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	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一定要加,不然就白做了

        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.36148641274659x):
#include<algorithm>

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	return 0;

}
// Slower C++ solution:
//666yuchen

#include<bits/stdc++.h>

using namespace std;

string st;

char b[500];

int main()

{

  cin>>st;

  b['b']='d';b['d']='b';b['p']='q';b['q']='p';

  for(int i=0;i<st.size();i++)if(b[st[i]]!=st[st.size()-1-i]){cout<<"No"<<endl;return 0;}

  cout<<"Yes"<<endl;

  return 0;

}

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

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	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.36148641274659x):
#include<algorithm>

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

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

    return 0;

}

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

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	return 0;

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

using namespace std;

long long i;

string s,S;

int main()

{

	std::ios_base::sync_with_stdio(false),cin.tie(0);

	cin>>s,S=s,reverse(s.begin(),s.end());

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

		s[i]==98?s[i]=100:s[i]==100?s[i]=98

			:s[i]==112?s[i]=113:s[i]==113?s[i]=112:0;

	s==S?puts("Yes"):puts("No");

	return 0;

}

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

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	return 0;

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

using namespace std;

int main()

{

    string a,b;

	cin>>a;b=a;

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

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

	}

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

	else cout<<"No";

}

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

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	return 0;

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

#include <cstring>

#include <algorithm>

using namespace std;

char s[100001],ss[100001];

int main(){

	scanf("%s",s);

	memcpy(ss,s,sizeof(s));

	int n=strlen(s);

	reverse(s,s+n);

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

		switch(s[i]){

			case 'd':

				s[i]='b';

				break;

			case 'b':

				s[i]='d';

				break;

			case 'p':

				s[i]='q';

				break;

			case 'q':

				s[i]='p';

				break;

		}

	puts(strcmp(ss,s)?"No":"Yes");

	return 0;

}

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

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	return 0;

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

using namespace std;

int main() {

	string a, b;

	cin >> a;

	b = a;

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

	for(int i = 0; i < b.size(); 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';

	}

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

}

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

#include<cstdio>

#include<cstring>

#define N 100010

using namespace std;

char a[N],b[N];

int len;

signed main(int argc,char **argv)

{

	scanf("%s",&a);len=strlen(a);

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

	for(int i=0;i<len;++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 b[i]='p';

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

	if(a[i]!=b[i]){printf("No");return 0;}

	printf("Yes");

	return 0;

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

#include <iostream>

#include <cstring>

using namespace std;

string s;



string rev(string ori){

	string ss=ori;

	int j=ori.length()-1;

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

		ss[i]=ori[j];j--;

	}

	return ss;

}



int main(){

	cin>>s;

	string s2=s;

	string s3=rev(s);

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

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

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

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

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

	}

	string s4=rev(s2);

	//cout<<s2<<endl<<s3<<endl<<s4<<endl;

	if(s2==s||s3==s||s4==s) cout<<"Yes";

	else cout<<"No";

	return 0;

}

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

#include <cstdlib>

#include <cstring>

#include <cstdio>

#include <string>

#include <queue>

#include <cmath>

#include <set>

#include <map>

const int oo=2139063143;

const int N=1010000;

const int P=1000000007;

using namespace std;

typedef long long LL;

typedef double db;

//char buf[1<<24],*p1=buf,*p2=buf,obuf[1<<23],*O=obuf;

//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)

typedef int DATA1;

typedef int DATA2;

inline void sc (DATA1 &x)

{

    x=0; static int p; p=1; static char c; c=getchar();

    while (!isdigit(c)) { if (c=='-') p=-1; c=getchar(); }

    while ( isdigit(c)) { x=(x<<1)+(x<<3)+(c-48); c=getchar(); }

    x*=p;

}

inline void print (DATA2 x)

{

	if (x< 0) putchar('-'),x=-x;

	if (x>=10) print(x/10);

	putchar(x%10+'0');

}

inline void pr (DATA2 x) { print(x),putchar('\n'); }

char change (char c)

{

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

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

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

	return 'p';

}

char s[N];

int main()

{

	//freopen (".in","r",stdin);

	//freopen (".out","w",stdout);

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

	int n=strlen (s+1);

	if (n&1) { puts("No"); return 0; }

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

		if (s[i]!=change (s[n-i+1])) { puts("No"); return 0; }

	puts("Yes");

	return 0;

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

using namespace std;

char str[100010];

int main() {

	scanf("%s",&str);

	int len=strlen(str);

	if(len%2!=0) {

		printf("No");

		return 0;

	}

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

		int r=abs(str[i]-str[len-i-1]);

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

			printf("No");

			return 0;

		}

	}

	printf("Yes");

	return 0;

}

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

#include <cstdlib>

#include <cstring>

#include <cstdio>

#include <string>

#include <queue>

#include <cmath>

#include <set>

#include <map>

const int oo=2139063143;

const int N=1010000;

const int P=1000000007;

using namespace std;

typedef long long LL;

typedef double db;

//char buf[1<<24],*p1=buf,*p2=buf,obuf[1<<23],*O=obuf;

//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)

typedef int DATA1;

typedef int DATA2;

inline void sc (DATA1 &x)

{

    x=0; static int p; p=1; static char c; c=getchar();

    while (!isdigit(c)) { if (c=='-') p=-1; c=getchar(); }

    while ( isdigit(c)) { x=(x<<1)+(x<<3)+(c-48); c=getchar(); }

    x*=p;

}

inline void print (DATA2 x)

{

	if (x< 0) putchar('-'),x=-x;

	if (x>=10) print(x/10);

	putchar(x%10+'0');

}

inline void pr (DATA2 x) { print(x),putchar('\n'); }

char change (char c)

{

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

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

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

	return 'p';

}

char s[N];

int main()

{

	//freopen (".in","r",stdin);

	//freopen (".out","w",stdout);

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

	int n=strlen (s+1);

	if (n&1) { puts("No"); return 0; }

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

		if (s[i]!=change (s[n-i+1])) { puts("No"); return 0; }

	puts("Yes");

	return 0;

}