#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[4], b[4];
  for (int i = 0; i < 4; i++) {
    cin >> a[i];
    b[3 - i] = a[i];
    if (b[3 - i] == 'd') {
      b[3 - i] = 'b';
    }
    if (b[3 - i] == 'b') {
      a[3 - i] = 'd';
    }
    if (b[3 - i] == 'p') {
      b[3 - i] = 'q';
    }
    if (b[3 - i] == 'q') {
      a[3 - i] = 'p';
    }
  }
  for (int i = 0; i < 4; i++) {
    if (a[i] != b[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
