stablegradients/pie-gem5-pairs huggingface dataset:
// 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.293318958851639x):
#include<cstdio>

#include<cstring>

using namespace std;

int len;

char str1[100001],str2[100001];

int main()

{

    scanf("%s",str1);

    strcpy(str2,str1);

    len=strlen(str1);

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

        str2[len-i-1]=str1[i];

    if(strcmp(str1,str2)==0)

    {

        printf("Yes");

        return 0;

    }

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

        switch(str2[i])

        {

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

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

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

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

        }

    if(strcmp(str1,str2)==0)

        printf("Yes");

    else

        printf("No");

}
// 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.304621046226455x):
#include<cstdio>

#include<cstring>

using namespace std;

int len;

char str1[100001],str2[100001];

int main()

{

    scanf("%s",str1);

    strcpy(str2,str1);

    len=strlen(str1);

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

        str2[len-i-1]=str1[i];

    if(strcmp(str1,str2)==0)

    {

        printf("Yes");

        return 0;

    }

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

        switch(str2[i])

        {

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

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

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

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

        }

    if(strcmp(str1,str2)==0)

        printf("Yes");

    else

        printf("No");

}
// 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: 1.174104889949586x):
#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");

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

#include<iostream>

#include<stack>

using namespace std;



stack<char>a;

char c [100004];

int bo;



char zh ( char p );



int main()

{

	string c;

	getline(cin,c);

	for(int i=0;c[i]!='\0';i++)

	{

		a.push(c[i]);

	}

	for(int i=0;c[i]!='\0';i++)

	{

		if(c[i]==zh(a.top()))

			a.pop();

		else

		{

			bo=1;

			break;

		}

	}

	if(bo==1)

		cout<<"No";

	else

		cout<<"Yes";

	return 0;

	}

char zh(char p)

{

	switch(p)

	{

		case 'p':return 'q';

		case 'q':return 'p';

		case 'b':return 'd';

		case 'd':return 'b';

	}

	return '0';

}

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

#define pritnf printf

#define scnaf scanf

#define retrun return

#define sizoef sizeof

#define inl inline

#define br break

#define con continue

#define mst(mst_a,mst_b) memset(mst_a,mst_b,sizeof(mst_a))

#define fora(fora_x,fora_a,fora_b) for(re nti (fora_x)=(fora_a);(fora_x)<=(fora_b);++(fora_x))

#define forb(forb_x,forb_a,forb_b) for(re nit (forb_x)=(forb_a);(forb_x)>=(forb_b);--(forb_x))

#define foral(foral_x,foral_a,foral_b) for(re ll (foral_x)=(foral_a);(foral_x)<=(foral_b);++(foral_x))

#define forbl(forbl_x,forbl_a,forbl_b) for(re ll (forbl_x)=(forbl_a);(forbl_x)>=(forbl_b);--(forbl_x))

#define re register

#define stt struct

#define nms namespace

#define gc getchar

#define sl(sl_a) strlen(sl_a)

#define gt(gt_a) goto gt_a

#define rt return

#define infa (0x3f3f3f3f)

#define infb (0x7fffffff)

#define infd (0x7f)

#define in(in_a) freopen("D:/""/in"in_a".in","r",stdin)

#define out(out_a) freopen("D:/""/out"out_a".out","w",stdout)

#define filein(filein_a) freopen(filein_a".in","r",stdin)

#define fileout(fileout_a) freopen(fileout_a".out","w",stdout)

#define file(file_a) filein(file_a);fileout(file_a)

typedef long long ll;

typedef int itn,nti,tin,tni,nit;

using namespace std;

const nit maxa=100004;

const nit maxb=1000004;

const nit maxc=4;

const tni maxd=10004;

#include<cstring>



tni s,ls;

char x[maxa];

bool f=1;



tni main()

{

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

    s=sl(x+1);

    //

    ls=s>>1;

    fora(i,1,ls)

    {

        if(x[i]!=x[s-i+1])

        {

            f=0;

            br;

        }

    }

    //

    if(f)

    {

        pritnf("Yes\n");

        rt 0;

    }

    //

    if(!(s%2))

    {

        f=1;

        fora(i,1,ls)

        {

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

            {

                f=0;

                br;

            }

        }

        //

        if(f)

        {

            printf("Yes\n");

            rt 0;

        }

    }

    //

    printf("No\n");

    rt 0;

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

#include<iostream>

#include<cstring>

#define maxn 100005

using namespace std;

char a[maxn],b[maxn];

char f[maxn];

int main(){

	f['b']='d';f['d']='b';

	f['p']='q';f['q']='p';

	cin>>a;int la=strlen(a);

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

		b[i]=f[a[la-i-1]];

	}

	int tip=0;

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

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

			tip=1;break;

		}

	}

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

	else cout<<"No";

	return 0;

}

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

#define pritnf printf

#define scnaf scanf

#define retrun return

#define sizoef sizeof

#define inl inline

#define br break

#define con continue

#define mst(mst_a,mst_b) memset(mst_a,mst_b,sizeof(mst_a))

#define fora(fora_x,fora_a,fora_b) for(re nti (fora_x)=(fora_a);(fora_x)<=(fora_b);++(fora_x))

#define forb(forb_x,forb_a,forb_b) for(re nit (forb_x)=(forb_a);(forb_x)>=(forb_b);--(forb_x))

#define foral(foral_x,foral_a,foral_b) for(re ll (foral_x)=(foral_a);(foral_x)<=(foral_b);++(foral_x))

#define forbl(forbl_x,forbl_a,forbl_b) for(re ll (forbl_x)=(forbl_a);(forbl_x)>=(forbl_b);--(forbl_x))

#define re register

#define stt struct

#define nms namespace

#define gc getchar

#define sl(sl_a) strlen(sl_a)

#define gt(gt_a) goto gt_a

#define rt return

#define infa (0x3f3f3f3f)

#define infb (0x7fffffff)

#define infd (0x7f)

#define in(in_a) freopen("D:/""/in"in_a".in","r",stdin)

#define out(out_a) freopen("D:/""/out"out_a".out","w",stdout)

#define filein(filein_a) freopen(filein_a".in","r",stdin)

#define fileout(fileout_a) freopen(fileout_a".out","w",stdout)

#define file(file_a) filein(file_a);fileout(file_a)

typedef long long ll;

typedef int itn,nti,tin,tni,nit;

using namespace std;

const nit maxa=100004;

const nit maxb=1000004;

const nit maxc=4;

const tni maxd=10004;

#include<cstring>



tni s,ls;

char x[maxa];

bool f=1;



tni main()

{

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

    s=sl(x+1);

    //

    ls=s>>1;

    fora(i,1,ls)

    {

        if(x[i]!=x[s-i+1])

        {

            f=0;

            br;

        }

    }

    //

    if(f)

    {

        pritnf("Yes\n");

        rt 0;

    }

    //

    if(!(s%2))

    {

        f=1;

        fora(i,1,ls)

        {

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

            {

                f=0;

                br;

            }

        }

        //

        if(f)

        {

            printf("Yes\n");

            rt 0;

        }

    }

    //

    printf("No\n");

    rt 0;

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

#include<stack>

using namespace std;

stack<char>s;

string k;

int main(){

    cin>>k;

    int lk=k.length();

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

	{

        s.push(k[i]);

    }

    bool flag=1;

    for(int i=0;i<lk;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==k[i])

		 {

            flag=1;

            s.pop();

        }

        else 

		{

            flag=0;

            break;

        }

    }

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

    else printf("Yes");

    return 0;

}

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

#define pritnf printf

#define scnaf scanf

#define retrun return

#define sizoef sizeof

#define inl inline

#define br break

#define con continue

#define mst(mst_a,mst_b) memset(mst_a,mst_b,sizeof(mst_a))

#define fora(fora_x,fora_a,fora_b) for(re nti (fora_x)=(fora_a);(fora_x)<=(fora_b);++(fora_x))

#define forb(forb_x,forb_a,forb_b) for(re nit (forb_x)=(forb_a);(forb_x)>=(forb_b);--(forb_x))

#define foral(foral_x,foral_a,foral_b) for(re ll (foral_x)=(foral_a);(foral_x)<=(foral_b);++(foral_x))

#define forbl(forbl_x,forbl_a,forbl_b) for(re ll (forbl_x)=(forbl_a);(forbl_x)>=(forbl_b);--(forbl_x))

#define re register

#define stt struct

#define nms namespace

#define gc getchar

#define sl(sl_a) strlen(sl_a)

#define gt(gt_a) goto gt_a

#define rt return

#define infa (0x3f3f3f3f)

#define infb (0x7fffffff)

#define infd (0x7f)

#define in(in_a) freopen("D:/""/in"in_a".in","r",stdin)

#define out(out_a) freopen("D:/""/out"out_a".out","w",stdout)

#define filein(filein_a) freopen(filein_a".in","r",stdin)

#define fileout(fileout_a) freopen(fileout_a".out","w",stdout)

#define file(file_a) filein(file_a);fileout(file_a)

typedef long long ll;

typedef int itn,nti,tin,tni,nit;

using namespace std;

const nit maxa=100004;

const nit maxb=1000004;

const nit maxc=4;

const tni maxd=10004;

#include<cstring>



tni s,ls;

char x[maxa];

bool f=1;



tni main()

{

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

    s=sl(x+1);

    //

    ls=s>>1;

    fora(i,1,ls)

    {

        if(x[i]!=x[s-i+1])

        {

            f=0;

            br;

        }

    }

    //

    if(f)

    {

        pritnf("Yes\n");

        rt 0;

    }

    //

    if(!(s%2))

    {

        f=1;

        fora(i,1,ls)

        {

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

            {

                f=0;

                br;

            }

        }

        //

        if(f)

        {

            printf("Yes\n");

            rt 0;

        }

    }

    //

    printf("No\n");

    rt 0;

}
// 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.3285784432902625x):
#include<cstdio>

#define pritnf printf

#define scnaf scanf

#define retrun return

#define sizoef sizeof

#define inl inline

#define br break

#define con continue

#define mst(mst_a,mst_b) memset(mst_a,mst_b,sizeof(mst_a))

#define fora(fora_x,fora_a,fora_b) for(re nti (fora_x)=(fora_a);(fora_x)<=(fora_b);++(fora_x))

#define forb(forb_x,forb_a,forb_b) for(re nit (forb_x)=(forb_a);(forb_x)>=(forb_b);--(forb_x))

#define foral(foral_x,foral_a,foral_b) for(re ll (foral_x)=(foral_a);(foral_x)<=(foral_b);++(foral_x))

#define forbl(forbl_x,forbl_a,forbl_b) for(re ll (forbl_x)=(forbl_a);(forbl_x)>=(forbl_b);--(forbl_x))

#define re register

#define stt struct

#define nms namespace

#define gc getchar

#define sl(sl_a) strlen(sl_a)

#define gt(gt_a) goto gt_a

#define rt return

#define infa (0x3f3f3f3f)

#define infb (0x7fffffff)

#define infd (0x7f)

#define in(in_a) freopen("D:/""/in"in_a".in","r",stdin)

#define out(out_a) freopen("D:/""/out"out_a".out","w",stdout)

#define filein(filein_a) freopen(filein_a".in","r",stdin)

#define fileout(fileout_a) freopen(fileout_a".out","w",stdout)

#define file(file_a) filein(file_a);fileout(file_a)

typedef long long ll;

typedef int itn,nti,tin,tni,nit;

using namespace std;

const nit maxa=100004;

const nit maxb=1000004;

const nit maxc=4;

const tni maxd=10004;

#include<cstring>



tni s,ls;

char x[maxa];

bool f=1;



tni main()

{

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

    s=sl(x+1);

    //

    ls=s>>1;

    fora(i,1,ls)

    {

        if(x[i]!=x[s-i+1])

        {

            f=0;

            br;

        }

    }

    //

    if(f)

    {

        pritnf("Yes\n");

        rt 0;

    }

    //

    if(!(s%2))

    {

        f=1;

        fora(i,1,ls)

        {

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

            {

                f=0;

                br;

            }

        }

        //

        if(f)

        {

            printf("Yes\n");

            rt 0;

        }

    }

    //

    printf("No\n");

    rt 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.122901372775346x):
#include<cstdio>

#define pritnf printf

#define scnaf scanf

#define retrun return

#define sizoef sizeof

#define inl inline

#define br break

#define con continue

#define mst(mst_a,mst_b) memset(mst_a,mst_b,sizeof(mst_a))

#define fora(fora_x,fora_a,fora_b) for(re nti (fora_x)=(fora_a);(fora_x)<=(fora_b);++(fora_x))

#define forb(forb_x,forb_a,forb_b) for(re nit (forb_x)=(forb_a);(forb_x)>=(forb_b);--(forb_x))

#define foral(foral_x,foral_a,foral_b) for(re ll (foral_x)=(foral_a);(foral_x)<=(foral_b);++(foral_x))

#define forbl(forbl_x,forbl_a,forbl_b) for(re ll (forbl_x)=(forbl_a);(forbl_x)>=(forbl_b);--(forbl_x))

#define re register

#define stt struct

#define nms namespace

#define gc getchar

#define sl(sl_a) strlen(sl_a)

#define gt(gt_a) goto gt_a

#define rt return

#define infa (0x3f3f3f3f)

#define infb (0x7fffffff)

#define infd (0x7f)

#define in(in_a) freopen("D:/""/in"in_a".in","r",stdin)

#define out(out_a) freopen("D:/""/out"out_a".out","w",stdout)

#define filein(filein_a) freopen(filein_a".in","r",stdin)

#define fileout(fileout_a) freopen(fileout_a".out","w",stdout)

#define file(file_a) filein(file_a);fileout(file_a)

typedef long long ll;

typedef int itn,nti,tin,tni,nit;

using namespace std;

const nit maxa=100004;

const nit maxb=1000004;

const nit maxc=4;

const tni maxd=10004;

#include<cstring>



tni s,ls;

char x[maxa];

bool f=1;



tni main()

{

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

    s=sl(x+1);

    //

    ls=s>>1;

    fora(i,1,ls)

    {

        if(x[i]!=x[s-i+1])

        {

            f=0;

            br;

        }

    }

    //

    if(f)

    {

        pritnf("Yes\n");

        rt 0;

    }

    //

    if(!(s%2))

    {

        f=1;

        fora(i,1,ls)

        {

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

            {

                f=0;

                br;

            }

        }

        //

        if(f)

        {

            printf("Yes\n");

            rt 0;

        }

    }

    //

    printf("No\n");

    rt 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.273990085137356x):
#include<cstdio>

#define pritnf printf

#define scnaf scanf

#define retrun return

#define sizoef sizeof

#define inl inline

#define br break

#define con continue

#define mst(mst_a,mst_b) memset(mst_a,mst_b,sizeof(mst_a))

#define fora(fora_x,fora_a,fora_b) for(re nti (fora_x)=(fora_a);(fora_x)<=(fora_b);++(fora_x))

#define forb(forb_x,forb_a,forb_b) for(re nit (forb_x)=(forb_a);(forb_x)>=(forb_b);--(forb_x))

#define foral(foral_x,foral_a,foral_b) for(re ll (foral_x)=(foral_a);(foral_x)<=(foral_b);++(foral_x))

#define forbl(forbl_x,forbl_a,forbl_b) for(re ll (forbl_x)=(forbl_a);(forbl_x)>=(forbl_b);--(forbl_x))

#define re register

#define stt struct

#define nms namespace

#define gc getchar

#define sl(sl_a) strlen(sl_a)

#define gt(gt_a) goto gt_a

#define rt return

#define infa (0x3f3f3f3f)

#define infb (0x7fffffff)

#define infd (0x7f)

#define in(in_a) freopen("D:/""/in"in_a".in","r",stdin)

#define out(out_a) freopen("D:/""/out"out_a".out","w",stdout)

#define filein(filein_a) freopen(filein_a".in","r",stdin)

#define fileout(fileout_a) freopen(fileout_a".out","w",stdout)

#define file(file_a) filein(file_a);fileout(file_a)

typedef long long ll;

typedef int itn,nti,tin,tni,nit;

using namespace std;

const nit maxa=100004;

const nit maxb=1000004;

const nit maxc=4;

const tni maxd=10004;

#include<cstring>



tni s,ls;

char x[maxa];

bool f=1;



tni main()

{

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

    s=sl(x+1);

    //

    ls=s>>1;

    fora(i,1,ls)

    {

        if(x[i]!=x[s-i+1])

        {

            f=0;

            br;

        }

    }

    //

    if(f)

    {

        pritnf("Yes\n");

        rt 0;

    }

    //

    if(!(s%2))

    {

        f=1;

        fora(i,1,ls)

        {

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

            {

                f=0;

                br;

            }

        }

        //

        if(f)

        {

            printf("Yes\n");

            rt 0;

        }

    }

    //

    printf("No\n");

    rt 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.796066820219617x):
#include<cstdio>

#define pritnf printf

#define scnaf scanf

#define retrun return

#define sizoef sizeof

#define inl inline

#define br break

#define con continue

#define mst(mst_a,mst_b) memset(mst_a,mst_b,sizeof(mst_a))

#define fora(fora_x,fora_a,fora_b) for(re nti (fora_x)=(fora_a);(fora_x)<=(fora_b);++(fora_x))

#define forb(forb_x,forb_a,forb_b) for(re nit (forb_x)=(forb_a);(forb_x)>=(forb_b);--(forb_x))

#define foral(foral_x,foral_a,foral_b) for(re ll (foral_x)=(foral_a);(foral_x)<=(foral_b);++(foral_x))

#define forbl(forbl_x,forbl_a,forbl_b) for(re ll (forbl_x)=(forbl_a);(forbl_x)>=(forbl_b);--(forbl_x))

#define re register

#define stt struct

#define nms namespace

#define gc getchar

#define sl(sl_a) strlen(sl_a)

#define gt(gt_a) goto gt_a

#define rt return

#define infa (0x3f3f3f3f)

#define infb (0x7fffffff)

#define infd (0x7f)

#define in(in_a) freopen("D:/""/in"in_a".in","r",stdin)

#define out(out_a) freopen("D:/""/out"out_a".out","w",stdout)

#define filein(filein_a) freopen(filein_a".in","r",stdin)

#define fileout(fileout_a) freopen(fileout_a".out","w",stdout)

#define file(file_a) filein(file_a);fileout(file_a)

typedef long long ll;

typedef int itn,nti,tin,tni,nit;

using namespace std;

const nit maxa=100004;

const nit maxb=1000004;

const nit maxc=4;

const tni maxd=10004;

#include<cstring>



tni s,ls;

char x[maxa];

bool f=1;



tni main()

{

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

    s=sl(x+1);

    //

    ls=s>>1;

    fora(i,1,ls)

    {

        if(x[i]!=x[s-i+1])

        {

            f=0;

            br;

        }

    }

    //

    if(f)

    {

        pritnf("Yes\n");

        rt 0;

    }

    //

    if(!(s%2))

    {

        f=1;

        fora(i,1,ls)

        {

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

            {

                f=0;

                br;

            }

        }

        //

        if(f)

        {

            printf("Yes\n");

            rt 0;

        }

    }

    //

    printf("No\n");

    rt 0;

}