#include <bits/stdc++.h>
using namespace std;
string a, b;
int main() {
  cin >> a >> b;
  int len = a.size();
  for (int i = 0; i < len; i++) {
    if (a[i] == 'b') b[i] = 'd';
    if (a[i] == 'd') b[i] = 'b';
    if (a[i] == 'p') b[i] = 'q';
    if (a[i] == 'q') b[i] = 'p';
  }
  bool flag = true;
  for (int i = 0, j = len - 1; i < len; i++, j--) {
    if (a[i] != b[i]) {
      flag = false;
      break;
    }
  }
  if (flag)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
