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

#define ll long long

#define MODV 1000000007

#define INFLL (1LL<<62) // 9223372036854775807

#define EPS 1e-9

#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)

#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)

#define all(v) v.begin(), v.end()

#define endl "\n"

#define vi vector<ll>

#define vvi vector<vector<ll>>

#define Yes() cout << "Yes" << endl

#define YES() cout << "YES" << endl

#define No() cout << "No" << endl

#define NO() cout << "NO" << endl

template<class T>bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1; } return 0; }

template<class T>bool chmin(T &a, const T &b){ if(b<a){ a=b; return 1; } return 0; }

using namespace std;



// 素因数分解：nの素因数分解を{素数, 指数}の形で昇順に返す。

ll primeFactorize(long long n){

    ll sum = 1;

    vector<pair<long long, long long>> ret;

    for(long long i=2; i*i<=n; i++){

        if(n%i != 0) continue;

        long long ex = 0;

        while(n%i == 0){ ex++; n /= i; }

        sum *= (ex+1);

    }

    if(n != 1) sum *= 2;

    return sum;

}



int main(){

    ll n;

    cin >> n;



    vector<bool> chkPrime(1000001, true);

    for(long long i=2; i<=1000001; i++){

        if(chkPrime[i]){

            for(long long j=2*i; j<=n; j+=i) chkPrime[j]=false;

        }

    }

    chkPrime[1] = false;

    vi isOK(n+1, 0);



    ll ans = 0;

    for(ll c=1; c<n; c++){

        ll tn = n-c, p = 1;

        if(chkPrime[tn]){

            ans += 2;

            continue;

        }

        ans += primeFactorize(tn);

    }

    cout << ans << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define ll long long

#define MODV 1000000007

#define INFLL (1LL<<62) // 9223372036854775807

#define EPS 1e-9

#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)

#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)

#define all(v) v.begin(), v.end()

#define endl "\n"

#define vi vector<ll>

#define vvi vector<vector<ll>>

#define Yes() cout << "Yes" << endl

#define YES() cout << "YES" << endl

#define No() cout << "No" << endl

#define NO() cout << "NO" << endl

#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);

template<class T>bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1; } return 0; }

template<class T>bool chmin(T &a, const T &b){ if(b<a){ a=b; return 1; } return 0; }

using namespace std;



int main(){

    Init();

    ll n;

    cin >> n;

    ll sum = 0;



    // a*b<nとなる正の整数(a,b)の組に対して、cは一意となる。

    // cが取りうる値は1~n-1である。

    // aを固定したとき、a*b<nを満たすようなbのとり方はfloor(n/a)通りある。

    // cは最小でも1以上必要なので、floor((n-1)/a)

    // aを1～n-1まで動かして和を取る。

    for(ll i=1; i<=n-1; i++) sum += (ll)floor((double)(n-1)/i);

    cout << sum << endl;

}

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

#include<vector>

#include<cstdio>

#include<cstring>

#include<iostream>

#include<algorithm>

using namespace std;



int cnt[27];

char s[100010];



int main()

{

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

	int len=strlen(s+1);

	if(len==2)

	{

		if(s[1]==s[2])

		{

			puts("1 2");

		}

		else

		{

			puts("-1 -1");

		}

		return 0;

	}

	cnt[s[1]-'a']++;

	cnt[s[2]-'a']++;

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

	{

		cnt[s[i+2]-'a']++;

		for(int j=0;j<26;j++)

		{

			if(cnt[j]>=2)

			{

				return printf("%d %d",i,i+2),0;

			}

		}

		cnt[s[i]-'a']--;

	}

	puts("-1 -1");

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

const int MAXN=100005;



int n;

char str[MAXN];

int cnt[30];



int main()

{

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

	n=strlen(str+1);

	if(n==2)

	{

		if(str[1]==str[2])

			puts("1 2");

		else

			puts("-1 -1");

		return 0;

	}

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

	{

		if(str[i]==str[i+1]||str[i]==str[i+2]||str[i+1]==str[i+2])

		{

			printf("%d %d\n",i,i+2);

			return 0;

		}

	}

	puts("-1 -1");

	

	return 0;

}


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

#define ft first

#define sc second

#define pt(sth) cout << sth << "\n"

#define moca(a, s, b) a=((a)s(b)+MOD)%MOD

using namespace std;

typedef long long ll;

typedef pair<ll, ll> pll;

template<class T>bool chmax(T &a, const T &b) {if(a<b) {a=b; return 1;} return 0;}

template<class T>bool chmin(T &a, const T &b) {if(b<a) {a=b; return 1;} return 0;}

static const ll INF=1e18;

static const ll MAX=101010;

static const ll MOD=1e9+7;





//for(i=0; i<N; i++) cin >> a[i];





int main(void) {

  ll i, j, k, l;

  

  ll N;

  cin >> N;

  ll a[MAX*2];

  ll cnt[66][66]={};

  pll f[MAX*2]={};

  

  map<double, ll> mp;

  for(i=0; i<N; i++) {

    double tt;

    cin >> tt;

    a[i]=llround(tt*1e9);

    

    ll t=a[i];

    ll c2=0, c5=0;

    while(t%2==0) {c2++; t/=2;}

    while(t%5==0) {c5++; t/=5;}

    cnt[c2][c5]++;

    f[i]={c2, c5};

  }

  

  

  ll ans=0;

  for(i=0; i<N; i++) {

    ll n2=max(18-f[i].ft, 0LL);

    ll n5=max(18-f[i].sc, 0LL);

    

    for(j=n2; j<66; j++) {

      for(k=n5; k<66; k++) {

        ans+=cnt[j][k];

      }

    }

    

    if(n2<=f[i].ft && n5<=f[i].sc) ans--;

  }

  ans/=2;

  pt(ans);

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define ft first

#define sc second

#define pt(sth) cout << sth << "\n"

#define moca(a, s, b) a=((a)s(b)+MOD)%MOD

using namespace std;

typedef long long ll;

typedef pair<ll, ll> pll;

template<class T>bool chmax(T &a, const T &b) {if(a<b) {a=b; return 1;} return 0;}

template<class T>bool chmin(T &a, const T &b) {if(b<a) {a=b; return 1;} return 0;}

static const ll INF=1e18;

static const ll MAX=101010;

static const ll MOD=1e9+7;





//for(i=0; i<N; i++) cin >> a[i];





int main(void) {

  ll i, j, k, l;

  

  ll N;

  cin >> N;

  ll a[MAX*2];

  ll cnt[22][22]={};

  

  map<double, ll> mp;

  for(i=0; i<N; i++) {

    double tt;

    cin >> tt;

    a[i]=llround(tt*1e9);

    

    ll t=a[i];

    ll c2=0, c5=0;

    while(t%2==0) {c2++; t/=2;}

    while(t%5==0) {c5++; t/=5;}

    cnt[min(18LL, c2)][min(18LL, c5)]++;

    

  }

  

  

  ll ans=0;

  for(i=0; i<22; i++) {

    for(j=0; j<22; j++) {

      for(k=0; k<22; k++) {

        for(l=0; l<22; l++) {

          if(i==k && j==l) continue;

          

          if(i+k>=18 && j+l>=18) {

            ans+=cnt[i][j]*cnt[k][l];

          }

        }

      }

    }

  }

  ans/=2;

  

  for(i=9; i<22; i++) {

    for(j=9; j<22; j++) {

      ans+=cnt[i][j]*(cnt[i][j]-1)/2;

    }

  }

  pt(ans);

  

}


// Fastest known solution for this problem:
// 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'){}

		else {

		    if(s[i]=='b'&&s[j]=='d'){}

		    else {

			if(s[i]=='d'&&s[j]=='b'){}

		          else {if(s[i]=='p'&&s[j]=='q'){}

		          else 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'){}

		else {

		    if(s[i]=='b'&&s[j]=='d'){}

		    else {

			if(s[i]=='d'&&s[j]=='b'){}

		          else {if(s[i]=='p'&&s[j]=='q'){}

		          else ok=1;

	              }

            }

        }

    }

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

    else cout<<"No";

	return 0;

} 

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

const int maxl=100010;

int l;

char str[maxl];

int main(){

	scanf("%s",&str);

	l=strlen(str);

	if(l%2!=0){

		printf("No\n");

		return 0;

	}

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

		if(str[i]=='b'&&str[l-i-1]!='d'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='d'&&str[l-i-1]!='b'){

		    printf("No\n");

		    return 0;

		}

		if(str[i]=='p'&&str[l-i-1]!='q'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='q'&&str[l-i-1]!='p'){

			printf("No\n");

		    return 0;

		}

	}

	printf("Yes\n");

	return 0;

}

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

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

const int maxl=100010;

int l;

char str[maxl];

int main(){

	scanf("%s",&str);

	l=strlen(str);

	if(l%2!=0){

		printf("No\n");

		return 0;

	}

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

		if(str[i]=='b'&&str[l-i-1]!='d'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='d'&&str[l-i-1]!='b'){

		    printf("No\n");

		    return 0;

		}

		if(str[i]=='p'&&str[l-i-1]!='q'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='q'&&str[l-i-1]!='p'){

			printf("No\n");

		    return 0;

		}

	}

	printf("Yes\n");

	return 0;

}

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

#include<cstdio>

#include<cstring>

#include<cmath>;

using namespace std;

string s;

int main(){

    cin>>s;

    int k=s.size();

    if(k%2!=0){

        printf("No");

        return 0;

    }

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

        int u=abs(s[i]-s[k-i-1]);

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

            printf("No");

            return 0;

        }

    }

    printf("Yes");

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

const int maxl=100010;

int l;

char str[maxl];

int main(){

	scanf("%s",&str);

	l=strlen(str);

	if(l%2!=0){

		printf("No\n");

		return 0;

	}

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

		if(str[i]=='b'&&str[l-i-1]!='d'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='d'&&str[l-i-1]!='b'){

		    printf("No\n");

		    return 0;

		}

		if(str[i]=='p'&&str[l-i-1]!='q'){

			printf("No\n");

		    return 0;

		}

		if(str[i]=='q'&&str[l-i-1]!='p'){

			printf("No\n");

		    return 0;

		}

	}

	printf("Yes\n");

	return 0;

}

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

using namespace std;

stack<char>m;

string a;

int main()

{

    cin>>a;

    int n=a.size();

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

      m.push(a[i]);

    bool j=1;

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

	{

        char top=m.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])

		{

            j=1;

            m.pop();

        }

        else

		{

            j=0;

            break;

        }

    }

    if(j==0)

      cout<<"No"<<endl;

    else

      cout<<"Yes"<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}

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

using namespace std;

int main()

{char a[100005];int n,i;

scanf("%s",a);

n=strlen(a);

if(n%2==1)

  {cout<<"No"<<endl;

  return 0;

  }

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

  if((a[i]==a[n-i-1])||(a[i]=='q'&&a[n-i-1]=='d')||(a[i]=='q'&&a[n-i-1]=='b')||(a[i]=='p'&&a[n-i-1]=='d')||(a[i]=='p'&&a[n-i-1]=='b'))

    {cout<<"No"<<endl;

    return 0;

	}

cout<<"Yes"<<endl;

return 0;

}

// Optimized solution to the same problem (faster):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}

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

#include<string>

#include<cmath>;

using namespace std;

string s;

int main(){

    cin>>s;

    int k=s.size();

    if(k%2!=0){

        cout<<"No";

        return 0;

    }

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

        int u=abs(s[i]-s[k-i-1]);

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

            cout<<"No"; 

            return 0;

        }

    }

    cout<<"Yes";

    return 0;

}

// Optimized solution to the same problem (faster):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}

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

#include<cstdio>

#include<cstring> 

using namespace std;

char a[100007],b[100007];

int main()

{

	scanf("%s",a);

	int len=strlen(a);

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

		{

			b[i]=a[len-i-1];

			b[len-i-1]=a[i];

		}

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

		{

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

				{

				b[i]='d';

				continue;

				}

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

				{

				b[i]='b';

				continue;

				}

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

					{

				b[i]='q';

				continue;

				}

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

				{

				b[i]='p';

				continue;

				}

		}

	int k=0;

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

		{

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

				continue;

			else

				{

					k=1;

					break;

				}

		}

	if(k==0)

		cout<<"Yes";

	else

		cout<<"No";

}

// Optimized solution to the same problem (faster):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}

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

using namespace std;

string s1;

int len;

stack<char> x;

int main()

{

	cin>>s1;

	len=s1.size();

	if(len%2!=0)

	{cout<<"No";return 0;}

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

	{

		x.push(s1[i]);

	}

	int flag=1;

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

	{

		char k=x.top();

		x.pop();

		{

			if(k=='b')

			k='d';

			else

			if(k=='d')

			k='b';

			else if(k=='p')

			k='q';

			else if(k=='q')

			k='p';

			if(k!=s1[i])

			{flag=0;break;}

		}

	}

	if(flag)

	cout<<"Yes";

	else

	cout<<"No";

	return 0;

}

// Optimized solution to the same problem (faster):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}

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

#include <iostream>

#include <string>



#define Rep(i, x, y) for (register int i = x; i <= y; i++)



int len;

std::string a, b;



int main()

{

    std::cin >> a;

    b = a;

    len = a.length();

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

    Rep(i, 0, len)

    {

        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)

        std::cout << "Yes";

    else

        std::cout << "No";

    return 0;

}

// Optimized solution to the same problem (faster):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}

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

}

// Optimized solution to the same problem (faster):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}

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

#include<string>

using namespace std;

string s;

int main()

{

	cin>>s;

	string s1=s;

	int n=s.length();

	if(n%2){cout<<"No";return 0;}

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

	{		

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

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

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

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

		if(s1[n-i-1]=='b')s1[n-i-1]='d';

		else if(s1[n-i-1]=='d')s1[n-i-1]='b';

		else if(s1[n-i-1]=='q')s1[n-i-1]='p';

		else if(s1[n-i-1]=='p')s1[n-i-1]='q';

		char t=s1[i];s1[i]=s1[n-i-1];s1[n-i-1]=t;

	}

//	cout<<s1<<endl<<s;

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

	else cout<<"No";

	return 0;

}


// Optimized solution to the same problem (faster):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}

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

using namespace std;

char s[100010],s1[100010];

int main()

{

    cin>>s;

    int l=strlen(s);

    if(l&1)

    {

    	cout<<"No";

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

    else cout<<"No";

    return 0;

}

// Optimized solution to the same problem (faster):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}

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

#include<cstdio>

#include<cmath>

#include<algorithm>

#include<cstring>

#define rep(i,a,b,k) for(register ll i=a;i<=b;i+=k)

#define drep(i,a,b,k) for(register ll i=a;i>=b;i-=k)

#define ll long long

#define mod 1000000007

using namespace std;

char a[100005];

int len;

bool flag=1;

int main()

{

	cin>>a;

	len=strlen(a)-1;

	if(!(len&1))

		puts("No"),exit(0);

	for(int i=0,j=len;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

		{

			flag=0;

			break;

		}

	}

	if(flag)

		puts("Yes"),exit(0);

	puts("No");

	return 0;

}

// Optimized solution to the same problem (faster):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),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<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}

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

# include <cstring>

# include <algorithm>

# include <string>

# include <iostream>

using namespace std;

int main()

{

	string a;

	cin>>a;

	string a1=a;

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

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

	{

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

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

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

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

	}

	if(a==a1) printf("Yes\n");

	else printf("No\n");

	return 0;

}

// Optimized solution to the same problem (faster):
#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

char s[100007];

int get[128];

int main()

{

    get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['q'] = 3;

    scanf("%s",s+1); // 从 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;

    } // 这个 +2 %4 刚好让 b 转到 d 上， d 转到 b 上， p 转到 q 上， q 转到 p 上 

    return printf("Yes\n"),0;

}

// Fastest known solution for this problem: