You are given a string S consisting of letters b, d, p, and q. Determine whether S is a mirror string. A mirror string is a string S such that reversing the order of the characters and simultaneously replacing each occurrence of b by d, d by b, p by q, and q by p results in the same string S. The input is given from Standard Input in the format of the string S. If S is a mirror string, print "Yes". Otherwise, print "No".

# Buggy version:
s = list(input())
t = list(s[::-1])
for i in range(len(s)):
    if t[i] == 'b':
        t[i] = 'd'
    if t[i] == 'd':
        t[i] = 'b'
    if t[i] == 'p':
        t[i] = 'q'
    else:
        t[i] = 'p'
if s == t:
    print('Yes')
else:
    print('No')

# Fixed version:
s = list(input())
t = list(s[::-1])
for i in range(len(s)):
    if t[i] == 'b':
        t[i] = 'd'
    elif t[i] == 'd':
        t[i] = 'b'
    elif t[i] == 'p':
        t[i] = 'q'
    else:
        t[i] = 'p'
if s == t:
    print('Yes')
else:
    print('No')

# Buggy version:
s = input().rstrip()
n = len(s)
if n % 2 == 1:
  print("No")
  exit()
for a, b in zip(s[n//2], s[::-1]):
  if a == "p" and b == "q":
    continue
  elif a == "q" and b == "p":
    continue
  elif a == "b" and b == "d":
    continue
  elif a == "d" and b == "b":
    continue
  else:
    print("No")
    exit()
print("Yes")

# Fixed version:
s = input().rstrip()
n = len(s)
if n % 2 == 1:
  print("No")
  exit()
for a, b in zip(s[:n//2], s[::-1]):
  if a == "p" and b == "q":
    continue
  elif a == "q" and b == "p":
    continue
  elif a == "b" and b == "d":
    continue
  elif a == "d" and b == "b":
    continue
  else:
    print("No")
    exit()
print("Yes")

# Buggy version:
s = list(input())
t = s[::-1]
for i in t:
  if i == "p":
    i = "q"
  elif i == "q":
    i = "p"
  if i == "b":
    i = "d"
  elif i == "d":
    i = "b" 
if s == t:
  ans = "Yes"
else:
  ans = "No"
print(ans)
    

# Fixed version:
s = list(input())
t = s[::-1]
for i in range(len(t)):
  if t[i] == "p":
    t[i] = "q"
  elif t[i] == "q":
    t[i] = "p"
  if t[i] == "b":
    t[i] = "d"
  elif t[i] == "d":
    t[i] = "b" 
if s == t:
  ans = "Yes"
else:
  ans = "No"
print(ans)

# Buggy version:

b='b'
d='d'
p='p'
q='q'
m=[(b,d),(p,q),(d,b),(q,p)]
ans='Yes'
s=input()
if len(s)%2==1:
    ans='No'
else:
    A=s[:len(s)//2]
    B=s[len(s)//2:]
    B=B[::-1]
    for i in range(len(s)//2):
        if (A[i],B[i]) in m:
            continue
        else:
            ans='NO'
print(ans)

# Fixed version:
b='b'
d='d'
p='p'
q='q'
m=[(b,d),(p,q),(d,b),(q,p)]
ans='Yes'
s=input()
if len(s)%2==1:
    ans='No'
else:
    A=s[:len(s)//2]
    B=s[len(s)//2:]
    B=B[::-1]
    for i in range(len(s)//2):
        if (A[i],B[i]) in m:
            continue
        else:
            ans='No'
print(ans)

# Buggy version:
n = list(input())

if n % 2 == 0:
	for i in range(len(n)//2):
		if n[i] =="b":
			if n[-(i+1)] != "d":
				print("No")
				exit()
		elif n[i] == "p":
			if n[-(i+1)] != "q":
				print("No")
				exit()
		elif n[i] == "d":
			if n[-(i+1)] != "b":
				print("No")
				exit()
		elif n[i] == "q":
			if n[-(i+1)] != "p":
				print("No")
				exit()
	print("Yes")
else:
	print("No")

# Fixed version:
n = list(input())

if len(n) % 2 == 0:
	for i in range(len(n)//2):
		if n[i] =="b":
			if n[-(i+1)] != "d":
				print("No")
				exit()
		elif n[i] == "p":
			if n[-(i+1)] != "q":
				print("No")
				exit()
		elif n[i] == "d":
			if n[-(i+1)] != "b":
				print("No")
				exit()
		elif n[i] == "q":
			if n[-(i+1)] != "p":
				print("No")
				exit()
	print("Yes")
else:
	print("No")

# Buggy version:
s = input()
is s[::-1].translate(str.maketrans("bdpq","dbqp")) == s:
  print("Yes")
else:
  print("No")

# Fixed version:
s = input()
if s[::-1].translate(str.maketrans("bdpq","dbqp")) == s:
  print("Yes")
else:
  print("No")

# Buggy version:
s = input()
ss = s[::-1]
for i,j in enumerate(ss):
    if j == "p":
      ss[i] = "q"
    elif j == "q":
      ss[i] = "p"
    elif j == "b":
      ss[i] = "d"
    else:
      ss[i] = "b"
if ss == s:
  print("Yes")
else:
  print("No")

# Fixed version:
s = input()
ss = s[::-1]
s3 = ""
for i,j in enumerate(ss):
  if j == "p":
      s3 += "q"
  elif j == "q":
      s3 += "p"
  elif j == "b":
      s3 += "d"
  else:
      s3 += "b"
if s == s3:
    print("Yes")
else:
    print("No")

# Buggy version:
import sys

dct = {"b": "d", "d", "b", "p": "q", "q": "p"}
S = sys.stdin.readline().strip()
rev = ""
for s in S[::-1]:
    rev += dct[s]

if rev == S:
    print("Yes")
else:
    print("No")

# Fixed version:
import sys

dct = {"b": "d", "d": "b", "p": "q", "q": "p"}
S = sys.stdin.readline().strip()
rev = ""
for s in S[::-1]:
    rev += dct[s]

if rev == S:
    print("Yes")
else:
    print("No")