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

#include<iostream>

#include<cstring>

#include<stack>

using namespace std;

stack<char>s;

string a;

int main()

{

    cin>>a;

    int n=a.size();

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

        s.push(a[i]);

    bool ju=1;

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

    {

        char top=s.top();

        if(top=='b')

            top='d';

        else if(top=='d')

            top='b';

        else if(top=='p')

            top='q';

        else if(top=='q')

            top='p';

        if(top==a[i])

        {

            ju=1;

            s.pop();

        }

        else

        {

            ju=0;

            break;

        }

    }

    if(ju==0)

        printf("No");

    else

        printf("Yes");

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.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; 

int main(){

    char a[100005],b[100005];

    cin>>a;

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

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

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

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

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

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

    }

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

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

            cout<<"No";

            return 0;

        }

    }

    cout<<"Yes";

    return 0;

}

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

#include <iostream>

#include <cstdio>



const int M = 500500;

char c[M], ch[M];

int len;



int main()

{

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

	len = strlen(c + 1);

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

	{

		switch (c[i])

		{

			case 'b':{

				ch[i] = 'd';

				break;

			}

			case 'd':{

				ch[i] = 'b';

				break;

			}

			case 'p':{

				ch[i] = 'q';

				break;

			}

			case 'q':{

				ch[i] = 'p';

				break;

			}

		}

	}

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

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

		{

			puts("No");

			return 0;

		}

	puts("Yes");

	return 0;

}

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

#include <algorithm>

using namespace std;

int main()

{

    std::ios::sync_with_stdio(false);

	string s;

	cin>>s;

	string x=s;

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

	int n=s.length();

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

	{

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

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

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

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

	}

	if(x==s)puts("Yes");

	else puts("No");

	return 0;

}

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

#include <string>

#include <algorithm>

using namespace std;

int main()

{

    string a,b;

    cin>>a;

    b=a;

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

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

		switch(a[i])

		{

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

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

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

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

		} 

    if(a==b)

		cout<<"Yes"<<endl;

    else

		cout<<"No"<<endl;

}

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

string a;

int main()

{

	cin>>a;

	int len=a.size();

	if(len%2==1) 

	{

		cout<<"No";

		cout<<endl;

		return 0;

	}

	int r=0;

	for(int i=0,j=len-1;i<j;i++,j--)

	{

		if((a[i]=='p' && a[j]=='q') || (a[i]=='q' && a[j]=='p') ||(a[i]=='d' && a[j]=='b') || (a[i]=='b' && a[j]=='d')) ;

		else 

		{

			r=1;

			break;

		}

	}

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

	else cout<<"No";

	cout<<endl;

	

	return 0;

}

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

int main()

{

	scanf("%s",s);

	int l=strlen(s);

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

	{

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

		{

			cout<<"No";

			return 0;

		}

	}

	cout<<"Yes";

}

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

#define maxn 500000

char a[maxn],b[maxn];

int s=1;

int main(){

	while(cin>>a[s]){

		s++;

	}

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

		b[i]=a[i];

	}

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

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

	}



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

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

		}

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

		 }

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

		}

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

		}

	}

	

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

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

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

		}

	}

	cout<<"Yes"<<endl;

	return 0;

}

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

}