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

using namespace std;

int main()

{

  string s;

  cin>>s;

  int n=s.size();

  int ok=0;

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

  {

    int j=n-i-1;

    if((s[i]=='q'&&s[j]=='p')||(s[i]=='b'&&s[j]=='d') ||(s[i]=='d'&&s[j]=='b')||(s[i]=='p'&&s[j]=='q')) {continue;}

    ok=1;

  }

  if(ok==0)

  {

    cout<<"Yes"<<endl;

    return 0;

  }

  ok=0;

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

  {

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

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

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

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

  }

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

  {

    int j=n-i-1;

    if((s[i]=='q'&&s[j]=='p')||(s[i]=='b'&&s[j]=='d') ||(s[i]=='d'&&s[j]=='b')||(s[i]=='p'&&s[j]=='q')) {continue;}

    ok=1;

  }

  if(ok==0)cout<<"Yes"<<endl;

  else cout<<"No";

  return 0;

}


// Optimized solution to the same problem (faster):
#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;

}


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

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

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)

    {

        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;

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
// =================================

//   author: memset0

//   date: 2018.12.25 22:11:27

//   website: https://memset0.cn/

// =================================

#include <bits/stdc++.h>

#define rep(i, l, r) for (register int i = l; i <= r; i++)

namespace ringo {

typedef long long ll;

typedef unsigned long long ull;

template <class T> inline void read(T &x) {

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

	while (!isdigit(c)) f ^= c == '-', c = getchar();

	while (isdigit(c)) x = x * 10 + c - '0', c = getchar();

	if (f) x = -x;

}

template <class T> inline void print(T x) {

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

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

	putchar('0' + x % 10);

}

template <class T> inline void maxd(T &a, T b) { if (b > a) a = b; }

template <class T> inline void mind(T &a, T b) { if (b < a) a = b; }

template <class T> inline void print(T x, char c) { print(x), putchar(c); }

template <class T> inline T abs(const T &a) { if (a < 0) return -a; return a; }



const int N = 1e5 + 10;

int n, m, a[N], b[N];

char s[N];



void main() {

	scanf("%s", s + 1), n = strlen(s + 1);

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

		switch (s[i]) {

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

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

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

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

		}

	for (int i = 1; i <= n; i++) b[i] = a[i];

	std::reverse(b + 1, b + n + 1);

	for (int i = 1; i <= n; i++) b[i] = (b[i] + 2) % 4;

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

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

			puts("No");

			return;

		}

	puts("Yes");

}



} signed main() { return ringo::main(), 0; }

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define rep(i,a,b) for(int i=a;i<=b;i++)

using namespace std;

string s;

int main(){

    cin>>s;

    string s1(s);

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

    rep(i,0,(int)s.size()-1){

        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==s)printf("Yes");

    else printf("No");

    return 0;

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

char s[100005],ss[100005];

signed main(){

	scanf("%s",s);

	int len=strlen(s);

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

		switch(s[i]){

			case 'b':{ss[len-i-1]='d';break;}

			case 'd':{ss[len-i-1]='b';break;}

			case 'p':{ss[len-i-1]='q';break;}

			case 'q':{ss[len-i-1]='p';break;}

		}

	}

	if(strcmp(s,ss))printf("No");

	else printf("Yes");

	return 0;

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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';

    }

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

        if(a[i]==b[i]) continue;

        else{

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

string s,b;

int main(){

	cin>>s;

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

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

		}

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

	return 0;

}

// Optimized solution to the same problem (faster):
#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;

}


// 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) printf("Yes"); else printf("No");

}

// Optimized solution to the same problem (faster):
#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;

}


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

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

}


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

    else cout<<"No"<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<cstring>

#include<map>

using namespace std;

int len;

char c[100001];

map<char,char>m;

int main()

{

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

	scanf("%s",&c);

	len=strlen(c);

	if(len&1)

	{

	    puts("No");

	    return 0;

	}

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

	{

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

		{

			puts("No");

			return 0;

		}

	}

	puts("Yes");

	return 0;

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem: