#include <bits/stdc++.h>
using namespace std;
char ch[10];
signed main() {
  register int cnt = 0;
  scanf("%s", 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)
    printf("Yes");
  else
    printf("No");
  return 0;
}
