#include <bits/stdc++.h>
using namespace std;
char ch[20];
signed main() {
  int cnt = 0;
  cin >> ch;
  if ((ch[0] == 'p') && (ch[3] == 'q')) cnt++;
  if ((ch[0] == 'q') && (ch[3] == 'p')) cnt++;
  if ((ch[1] == 'p') && (ch[2] == 'q')) cnt++;
  if ((ch[2] == 'p') && (ch[1] == 'q')) cnt++;
  if ((ch[1] == 'b') && (ch[2] == 'd')) cnt++;
  if ((ch[0] == 'b') && (ch[3] == 'd')) cnt++;
  if ((ch[0] == 'd') && (ch[3] == 'b')) cnt++;
  if ((ch[1] == 'd') && (ch[2] == 'b')) cnt++;
  if (cnt >= 2)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
