Problem:
Score : 100 points

Problem Statement

You are given a string S consisting of letters b, d, p and q.
Determine whether S is a mirror string.

Here, a mirror string is a string S such that the following sequence of operations on S results in the same string S:

Reverse the order of the characters in S.

Replace each occurrence of b by d, d by b, p by q, and q by p, simultaneously.

Constraints

1 \leq |S| \leq 10^5

S consists of letters b, d, p, and q.

Input

The input is given from Standard Input in the following format:

S

Output

If S is a mirror string, print Yes. Otherwise, print No.

Sample Input 1

pdbq

Sample Output 1

Yes

Sample Input 2

ppqb

Sample Output 2

No

Solution in C# (Mono 4.6.2.0) (judge verdict: Accepted)

using System;
using System.Collections.Generic;
using System.Linq;

namespace CSharpSample01
{
    
    class Program
    {
        
        static void Main(string[] args)
        {
            List<char> ch_in_origin = Console.ReadLine().ToList();

            List<char> ch_sub = new List<char>();

            for(int i = 0; i < ch_in_origin.Count(); i++)
            {
                ch_sub.Add(ch_in_origin[i]);
            }

            ch_in_origin.Reverse();

            for(int i = 0; i < ch_in_origin.Count(); i++)
            {
                char ch = ch_in_origin[i];

                if (ch == 'b') ch = 'd';
                else if (ch == 'd') ch = 'b';
                else if (ch == 'p') ch = 'q';
                else if (ch == 'q') ch = 'p';

                ch_in_origin[i] = ch;

            }

            for(int i = 0; i < ch_in_origin.Count(); i++)
            {
                if(ch_in_origin[i] != ch_sub[i])
                {
                    Console.WriteLine("No");
                    return;
                }
            }

            Console.WriteLine("Yes");
        }
    }
}